
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>13.4适配三方库之udid · Flutter for Harmony教程</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="坚果派">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-back-to-top-button/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-code/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-pageview-count/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search-plus/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-emphasize/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-forkmegithub/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-theme-lou/lou.css">
                
            
        

    

    
        
        <link rel="stylesheet" href="../styles/website.css">
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="12.5适配torch_light.html" />
    
    
    <link rel="prev" href="12.3适配三方库之FlutterToast.html" />
    

    </head>
    <body>
         
<div class="donate-modal modal">
  <div class="modal-header">
    <div>
      <span>
        <img
          id="modal-avatar"
          class="modal-avatar"
          src="http://xkapp-uat.oss-cn-hangzhou.aliyuncs.com/2e7a3f70-80ab-4b50-93ec-a04dfeef949b/avatar-100.png"
        />
      </span>
      <span id="nickname"> breeze </span>
      <p class="modal-close close" onclick="closeDonateModal()">×</p>
    </div>
    <div class="message">
      <div class="tip">
        <i></i>
        <span>随意打赏，但不要超过一顿早餐钱 💕</span>
      </div>
    </div>
  </div>
  <div class="modal-content">
    <div class="modal-pay-way">
      <div id="wxpay" onclick="showDonateImg(0)">
        <input
          type="radio"
          name="pay-way"
          value="wxpay"
          class="zs-type"
          checked="checked"
        />
        <span>
          <img
            id="wxpay-logo"
            src=""
          />
        </span>
      </div>
      <div id="alipay" onclick="showDonateImg(1)">
        <input type="radio" name="pay-way" value="alipay" class="zs-type" />
        <span>
          <img
            id="alipay-logo"
            src=""
          />
        </span>
      </div>
    </div>
    <div class="modal-pay-qrcode">
      <img id="wxpay-code" src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210922202901895.png" />
      <img
        id="alipay-code"
        src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210922202843746.png"
        hidden
      />
    </div>
  </div>
</div>
<div class="mask"></div>


<div class="book">
  <div class="header-inner">
    <!-- LOGO -->
    <div class="logo"></div>
    <span class="title"></span>

    <!-- Search -->
    
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>


    <!-- Nav -->
    <ul class="header-nav">
      <li>
        <a href="https://www.nutpi.net/" target="_blank">坚果派官网</a>
      </li><li>
        <a href="https://www.arkui.club/" target="_blank">ArkUI实战</a>
      </li><li>
        <a href="https://space.bilibili.com/480883651" target="_blank">哔哩哔哩</a>
      </li><li>
        <a href="https://gitcode.com/nutpi" target="_blank">GitCode</a>
      </li>
    </ul>
  </div>

  <div class="book-summary">
    <div class="book-summary-title">文档目录</div>
     
    <nav role="navigation">


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    1.前言
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../坚果派介绍.html">
            
                <a href="../坚果派介绍.html">
            
                    
                    2.坚果派介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../chapter2/">
            
                <a href="../chapter2/">
            
                    
                    3.Flutter鸿蒙化
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../chapter1/01Flutter介绍.html">
            
                <a href="../chapter1/01Flutter介绍.html">
            
                    
                    3.1 Flutter介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../chapter1/02HarmonyOS与OpenHarmony介绍.html">
            
                <a href="../chapter1/02HarmonyOS与OpenHarmony介绍.html">
            
                    
                    3.2 背景与原理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../chapter1/02功能开发.html">
            
                <a href="../chapter1/02功能开发.html">
            
                    
                    3.3 功能开发
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="../chapter1/03Flutter_Engine编译.html">
            
                <a href="../chapter1/03Flutter_Engine编译.html">
            
                    
                    3.4 Flutter Engine编译
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="../chapter1/03FutterEntry使用.html">
            
                <a href="../chapter1/03FutterEntry使用.html">
            
                    
                    3.5 FutterEntry使用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.6" data-path="../chapter1/04性能调优.html">
            
                <a href="../chapter1/04性能调优.html">
            
                    
                    3.6 性能调优
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.7" data-path="../chapter1/05OHOS平台适配flutter三方库.html">
            
                <a href="../chapter1/05OHOS平台适配flutter三方库.html">
            
                    
                    3.7 OHOS平台适配flutter三方库
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.8" data-path="../chapter1/06如何使用_Flutter_Channel.html">
            
                <a href="../chapter1/06如何使用_Flutter_Channel.html">
            
                    
                    3.8 如何使用Flutter Channel
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.9" data-path="../chapter1/07开发Flutter静态库.html">
            
                <a href="../chapter1/07开发Flutter静态库.html">
            
                    
                    3.9 开发Flutter静态库
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.10" data-path="../chapter1/FAQ.html">
            
                <a href="../chapter1/FAQ.html">
            
                    
                    3.10 FAQ
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.11" data-path="../chapter1/服务.html">
            
                <a href="../chapter1/服务.html">
            
                    
                    3.11 服务
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.12" data-path="../chapter1/资料整理.html">
            
                <a href="../chapter1/资料整理.html">
            
                    
                    3.12 资料整理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.13" data-path="../chapter2/2.3Impeller渲染引擎.html">
            
                <a href="../chapter2/2.3Impeller渲染引擎.html">
            
                    
                    3.13 Impeller渲染引擎
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../chapter3/">
            
                <a href="../chapter3/">
            
                    
                    4.Flutter与Dart介绍
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../chapter3/3.1Flutter介绍.html">
            
                <a href="../chapter3/3.1Flutter介绍.html">
            
                    
                    4.1 Flutter介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../chapter3/3.2Dart介绍.html">
            
                <a href="../chapter3/3.2Dart介绍.html">
            
                    
                    4.2 Dart介绍
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../chapter4/">
            
                <a href="../chapter4/">
            
                    
                    5.HarmonyOS/OpenHarmony与ArkTS介绍
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../chapter4/4.1HarmonyOS.html">
            
                <a href="../chapter4/4.1HarmonyOS.html">
            
                    
                    5.1 HarmonyOS
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../chapter4/4.2OpenHarmony.html">
            
                <a href="../chapter4/4.2OpenHarmony.html">
            
                    
                    5.2 OpenHarmony
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../chapter4/4.3HarmonyOSNEXT.html">
            
                <a href="../chapter4/4.3HarmonyOSNEXT.html">
            
                    
                    5.3 HarmonyOS NEXT
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="../chapter4/4.4ArkTS语言_.html">
            
                <a href="../chapter4/4.4ArkTS语言_.html">
            
                    
                    5.4 ArkTS语言
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5" data-path="../chapter4/4.5三者的差异.html">
            
                <a href="../chapter4/4.5三者的差异.html">
            
                    
                    5.5 三者的区别与联系
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.6" data-path="../chapter4/4.6从开发者视角看_uniapp_与_Flutter_的差异.html">
            
                <a href="../chapter4/4.6从开发者视角看_uniapp_与_Flutter_的差异.html">
            
                    
                    5.6 从开发者视角看uniapp与Flutter的差异
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../chapter5/">
            
                <a href="../chapter5/">
            
                    
                    6.鸿蒙Flutter开发环境配置
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../chapter5/5.1windows环境配置.html">
            
                <a href="../chapter5/5.1windows环境配置.html">
            
                    
                    6.1 Windows环境配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../chapter5/5.2mac环境配置.md">
            
                <span>
            
                    
                    6.2 Mac环境配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../chapter5/5.2mac环境配置3.32.html">
            
                <a href="../chapter5/5.2mac环境配置3.32.html">
            
                    
                    6.3 Mac环境配置3.32版本
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../chapter5/5.3使用_FlutterSDK_3.22.1.html">
            
                <a href="../chapter5/5.3使用_FlutterSDK_3.22.1.html">
            
                    
                    6.4 使用FlutterSDK 3.22.1
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="../chapter5/5.4第一个鸿蒙Flutter应用程序.html">
            
                <a href="../chapter5/5.4第一个鸿蒙Flutter应用程序.html">
            
                    
                    6.5 第一个鸿蒙Flutter应用程序
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6" data-path="../chapter5/5.5鸿蒙Flutter运行到多平台.html">
            
                <a href="../chapter5/5.5鸿蒙Flutter运行到多平台.html">
            
                    
                    6.6 运行到多平台
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7" data-path="../chapter5/5.5Mac环境Java配置指南.html">
            
                <a href="../chapter5/5.5Mac环境Java配置指南.html">
            
                    
                    6.7 Mac环境Java配置指南
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.8" data-path="../chapter5/5.6使用最新的fluttersdk配置开发环境.html">
            
                <a href="../chapter5/5.6使用最新的fluttersdk配置开发环境.html">
            
                    
                    6.8 使用最新FlutterSDK配置开发环境
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.9" data-path="../chapter5/5.7OpenHarmony设备运行指导.html">
            
                <a href="../chapter5/5.7OpenHarmony设备运行指导.html">
            
                    
                    6.9 OpenHarmony设备运行指导
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.10" data-path="../chapter5/5.8现有项目支持鸿蒙.html">
            
                <a href="../chapter5/5.8现有项目支持鸿蒙.html">
            
                    
                    6.10 现有Flutter项目支持鸿蒙
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.11" data-path="../chapter5/5.9鸿蒙版Flutter仓库变更.html">
            
                <a href="../chapter5/5.9鸿蒙版Flutter仓库变更.html">
            
                    
                    6.11 鸿蒙版Flutter仓库变更
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.12" data-path="../chapter5/5.10真机与模拟器.html">
            
                <a href="../chapter5/5.10真机与模拟器.html">
            
                    
                    6.12 真机与模拟器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.13" data-path="../chapter5/5.11使用fvm.html">
            
                <a href="../chapter5/5.11使用fvm.html">
            
                    
                    6.13 使用FVM管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.14" data-path="../chapter5/5.12Ma环境FVM安裝指南.html">
            
                <a href="../chapter5/5.12Ma环境FVM安裝指南.html">
            
                    
                    6.14 Mac环境FVM安装指南
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.15" data-path="../chapter5/5.12使用3.27.4构建鸿蒙应用.html">
            
                <a href="../chapter5/5.12使用3.27.4构建鸿蒙应用.html">
            
                    
                    6.15 使用3.27.4构建鸿蒙应用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.16" data-path="../chapter5/5.13使用_Flutter_SDK_3.27.4构建HarmonyOS应用.html">
            
                <a href="../chapter5/5.13使用_Flutter_SDK_3.27.4构建HarmonyOS应用.html">
            
                    
                    6.16 使用Flutter SDK 3.27.4构建HarmonyOS应用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.17" data-path="../chapter5/5.14Flutter-OH版本演进规划和分支策略.html">
            
                <a href="../chapter5/5.14Flutter-OH版本演进规划和分支策略.html">
            
                    
                    6.17 Flutter-OH版本演进规划和分支策略
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.18" data-path="../chapter5/5.15mac环境配置3.22版本.html">
            
                <a href="../chapter5/5.15mac环境配置3.22版本.html">
            
                    
                    6.18 mac环境配置3.22版本
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../chapter6/">
            
                <a href="../chapter6/">
            
                    
                    7.在鸿蒙应用中添加Flutter页面
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../chapter6/6.1如何使用FlutterPage.html">
            
                <a href="../chapter6/6.1如何使用FlutterPage.html">
            
                    
                    7.1 如何使用FlutterPage
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../chapter6/6.2如何使用混合开发添加跳转_FlutterEntry.html">
            
                <a href="../chapter6/6.2如何使用混合开发添加跳转_FlutterEntry.html">
            
                    
                    7.2 如何使用混合开发添加跳转FlutterEntry
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="../chapter6/6.3在鸿蒙应用中添加Flutter页面.html">
            
                <a href="../chapter6/6.3在鸿蒙应用中添加Flutter页面.html">
            
                    
                    7.3 在鸿蒙应用中添加Flutter页面
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../chapter7/">
            
                <a href="../chapter7/">
            
                    
                    8.Flutter与HarmonyOS混合开发进阶
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../chapter7/7.1如何使用_FlutterPage.md">
            
                <span>
            
                    
                    8.1 如何使用FlutterPage
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="../chapter7/7.2如何使用混合开发添加跳转_FlutterEntry.md">
            
                <span>
            
                    
                    8.2 如何使用混合开发添加跳转FlutterEntry
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3" data-path="../chapter7/7.3_harmonyos添加flutter页面跳转时路由的处理.html">
            
                <a href="../chapter7/7.3_harmonyos添加flutter页面跳转时路由的处理.html">
            
                    
                    8.3 harmonyos添加flutter页面跳转时路由的处理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.4" data-path="../chapter7/7.4使用FlutterChannel实现和Flutter和HarmonyOS交互.html">
            
                <a href="../chapter7/7.4使用FlutterChannel实现和Flutter和HarmonyOS交互.html">
            
                    
                    8.4 使用FlutterChannel实现和Flutter和HarmonyOS交互
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../chapter8/">
            
                <a href="../chapter8/">
            
                    
                    9.在鸿蒙应用中使用Flutter Channel能力
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" data-path="../chapter8/8.1如何使用混合开发_module.html">
            
                <a href="../chapter8/8.1如何使用混合开发_module.html">
            
                    
                    9.1 如何使用混合开发module
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.2" data-path="../chapter8/8.2如何使用混合开发添加跳转_FlutterEntry.html">
            
                <a href="../chapter8/8.2如何使用混合开发添加跳转_FlutterEntry.html">
            
                    
                    9.2 如何使用混合开发添加跳转FlutterEntry
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.3" data-path="../chapter8/8.3如何使用lutter和鸿蒙next混合渲染.html">
            
                <a href="../chapter8/8.3如何使用lutter和鸿蒙next混合渲染.html">
            
                    
                    9.3 如何使用Flutter和鸿蒙NEXT混合渲染
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4" data-path="../chapter8/8.4_混合渲染开发实践:以scan_三方库为例.html">
            
                <a href="../chapter8/8.4_混合渲染开发实践:以scan_三方库为例.html">
            
                    
                    9.4 混合渲染开发实践：以fluttertpc_scan三方库为例
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.5" data-path="../chapter8/8.5如何使用Flutter与鸿蒙通信_FlutterChannel.html">
            
                <a href="../chapter8/8.5如何使用Flutter与鸿蒙通信_FlutterChannel.html">
            
                    
                    9.5 如何使用Flutter与鸿蒙通信FlutterChannel
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.6" data-path="../chapter8/8.7Har包模式引入.html">
            
                <a href="../chapter8/8.7Har包模式引入.html">
            
                    
                    9.6 Har包模式引入
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.7" data-path="../chapter8/8.7源码模式引入.html">
            
                <a href="../chapter8/8.7源码模式引入.html">
            
                    
                    9.7 源码模式引入
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.8" data-path="../chapter8/8.8初始化Flutter.html">
            
                <a href="../chapter8/8.8初始化Flutter.html">
            
                    
                    9.8 初始化Flutter
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.9" data-path="../chapter8/8.9跳转Flutter页面.html">
            
                <a href="../chapter8/8.9跳转Flutter页面.html">
            
                    
                    9.9 跳转Flutter页面
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="../chapter9/">
            
                <a href="../chapter9/">
            
                    
                    10.与原生混合渲染
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.10.1" data-path="../chapter9/9.1flutter鸿蒙化背景.html">
            
                <a href="../chapter9/9.1flutter鸿蒙化背景.html">
            
                    
                    10.1 Flutter鸿蒙化背景
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.2" data-path="../chapter9/9.1外接纹理适配.html">
            
                <a href="../chapter9/9.1外接纹理适配.html">
            
                    
                    10.2 Flutter OHOS外接纹理适配简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.3" data-path="../chapter9/9.2如何使用多引擎_FlutterEngineGroup.html">
            
                <a href="../chapter9/9.2如何使用多引擎_FlutterEngineGroup.html">
            
                    
                    10.3 如何使用多引擎FlutterEngineGroup
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.4" data-path="../chapter9/9.3如何使用PlatformView.html">
            
                <a href="../chapter9/9.3如何使用PlatformView.html">
            
                    
                    10.4 如何使用PlatformView
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.5" data-path="../chapter9/9.4PlatformView同层渲染方案适配切换指导.html">
            
                <a href="../chapter9/9.4PlatformView同层渲染方案适配切换指导.html">
            
                    
                    10.5 PlatformView同层渲染方案适配切换指导
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="../chapter10/">
            
                <a href="../chapter10/">
            
                    
                    11.开发Flutter静态库
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.11.1" data-path="../chapter10/10.1开发module.html">
            
                <a href="../chapter10/10.1开发module.html">
            
                    
                    11.1开发module
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2" data-path="../chapter10/10.2开发package.html">
            
                <a href="../chapter10/10.2开发package.html">
            
                    
                    11.2开发package
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.3" data-path="../chapter10/10.3开发plugin.html">
            
                <a href="../chapter10/10.3开发plugin.html">
            
                    
                    11.3开发plugin
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.4" data-path="../chapter10/10.4开发FFI_plugin.html">
            
                <a href="../chapter10/10.4开发FFI_plugin.html">
            
                    
                    11.4开发FFI plugin
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="../chapter11/">
            
                <a href="../chapter11/">
            
                    
                    12.Packages使用指南
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.12.1" data-path="../chapter11/11.1高效使用_Packages指南.html">
            
                <a href="../chapter11/11.1高效使用_Packages指南.html">
            
                    
                    12.1高效使用Packages指南
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.2" data-path="../chapter11/11.2发布Packages.html">
            
                <a href="../chapter11/11.2发布Packages.html">
            
                    
                    12.2发布Packages
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.3" data-path="../chapter11/11.3使用fvm管理.html">
            
                <a href="../chapter11/11.3使用fvm管理.html">
            
                    
                    12.3使用fvm管理
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="./">
            
                <a href="./">
            
                    
                    13.鸿蒙适配Flutter三方库
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.13.1" data-path="12.1纯dart库无需迁移.html">
            
                <a href="12.1纯dart库无需迁移.html">
            
                    
                    13.1纯dart库无需迁移
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.2" data-path="12.2坚果派已适配的库.html">
            
                <a href="12.2坚果派已适配的库.html">
            
                    
                    13.2坚果派目前适配三方库进展
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.3" data-path="12.3适配三方库之FlutterToast.html">
            
                <a href="12.3适配三方库之FlutterToast.html">
            
                    
                    13.3适配三方库之FlutterToast
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.13.4" data-path="12.4适配三方库之udid.html">
            
                <a href="12.4适配三方库之udid.html">
            
                    
                    13.4适配三方库之udid
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.5" data-path="12.5适配torch_light.html">
            
                <a href="12.5适配torch_light.html">
            
                    
                    13.5适配torch_light
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.6" data-path="12.6适配flutter_native_contact_picker.html">
            
                <a href="12.6适配flutter_native_contact_picker.html">
            
                    
                    13.6适配flutter_native_contact_picker
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.7" data-path="12.7适配flutter_timezone.html">
            
                <a href="12.7适配flutter_timezone.html">
            
                    
                    13.7适配flutter_timezone
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.8" data-path="12.8适配flutter_exit_app.html">
            
                <a href="12.8适配flutter_exit_app.html">
            
                    
                    13.8适配flutter_exit_app
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.9" data-path="12.9适配flutter_phone_direct_caller.html">
            
                <a href="12.9适配flutter_phone_direct_caller.html">
            
                    
                    13.9适配flutter_phone_direct_caller
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.10" data-path="12.10适配flutter_app_icon_badge.html">
            
                <a href="12.10适配flutter_app_icon_badge.html">
            
                    
                    13.10适配flutter_app_icon_badge
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.11" data-path="12.10适配screen_capture_event.html">
            
                <a href="12.10适配screen_capture_event.html">
            
                    
                    13.11适配screen_capture_event
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.12" data-path="12.10适配screenshot_callback.html">
            
                <a href="12.10适配screenshot_callback.html">
            
                    
                    13.12适配screenshot_callback
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.13" data-path="12.11适配memory_info.html">
            
                <a href="12.11适配memory_info.html">
            
                    
                    13.13适配memory_info
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.14" data-path="12.11适配screen_brightness.html">
            
                <a href="12.11适配screen_brightness.html">
            
                    
                    13.14适配screen_brightness
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.15" data-path="12.12适配battey_level_plus.html">
            
                <a href="12.12适配battey_level_plus.html">
            
                    
                    13.15适配battey_level_plus
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.16" data-path="12.13适配flutter_badge_plus.html">
            
                <a href="12.13适配flutter_badge_plus.html">
            
                    
                    13.16适配flutter_badge_plus
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.17" data-path="12.14适配flutter_native_contact_picker_plus.html">
            
                <a href="12.14适配flutter_native_contact_picker_plus.html">
            
                    
                    13.17适配flutter_native_contact_picker_plus
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.18" data-path="12.15获取设备随机存取存储器_(RAM">
            
                <span>
            
                    
                    13.18获取设备随机存取存储器 (RAM) 大小
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.19" data-path="12.16适配system_info_plus.html">
            
                <a href="12.16适配system_info_plus.html">
            
                    
                    13.19适配system_info_plus
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.20" data-path="12.17适配app_badge_plus.html">
            
                <a href="12.17适配app_badge_plus.html">
            
                    
                    13.20适配app_badge_plus
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.21" data-path="12.18适配flutter_native_contact_picker_plus.md">
            
                <span>
            
                    
                    13.21适配flutter_native_contact_picker_plus
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.22" data-path="12.19device_info_plus插件适配.html">
            
                <a href="12.19device_info_plus插件适配.html">
            
                    
                    13.22device_info_plus插件适配
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.23" data-path="12.20package_info_plus.html">
            
                <a href="12.20package_info_plus.html">
            
                    
                    13.23package_info_plus
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.24" data-path="12.21NetworkInfo适配.html">
            
                <a href="12.21NetworkInfo适配.html">
            
                    
                    13.24NetworkInfo适配
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.25" data-path="12.22url_luacher适配指南.html">
            
                <a href="12.22url_luacher适配指南.html">
            
                    
                    13.25url_luacher适配指南
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.26" data-path="di.html">
            
                <a href="di.html">
            
                    
                    13.26依赖注入
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.14" data-path="../chapter13/">
            
                <a href="../chapter13/">
            
                    
                    14.性能优化与调试
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.14.1" data-path="../chapter13/13.1环境配置.html">
            
                <a href="../chapter13/13.1环境配置.html">
            
                    
                    14.1 环境配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.2" data-path="../chapter13/13.2Flutter_开发鸿蒙应用时三方库引入指南.html">
            
                <a href="../chapter13/13.2Flutter_开发鸿蒙应用时三方库引入指南.html">
            
                    
                    14.2 Flutter开发鸿蒙应用时三方库引入指南
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.3" data-path="../chapter13/13.2性能分析定界指南.html">
            
                <a href="../chapter13/13.2性能分析定界指南.html">
            
                    
                    14.3 性能分析定界指南
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.4" data-path="../chapter13/13.3梳理线程顺序.html">
            
                <a href="../chapter13/13.3梳理线程顺序.html">
            
                    
                    14.4 性能分析第一步-梳理线程顺序
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.5" data-path="../chapter13/13.4滑动响应时延.html">
            
                <a href="../chapter13/13.4滑动响应时延.html">
            
                    
                    14.5 性能分析-滑动响应时延
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.6" data-path="../chapter13/13.5帧渲染跟踪.html">
            
                <a href="../chapter13/13.5帧渲染跟踪.html">
            
                    
                    14.6 性能分析-帧渲染跟踪
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.7" data-path="../chapter13/13.6如何调试代码.html">
            
                <a href="../chapter13/13.6如何调试代码.html">
            
                    
                    14.7 如何调试代码
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.8" data-path="../chapter13/13.7在_Flutter_中实现鸿蒙平台引入_package，其他平台排除.html">
            
                <a href="../chapter13/13.7在_Flutter_中实现鸿蒙平台引入_package，其他平台排除.html">
            
                    
                    14.8 在Flutter中实现鸿蒙平台引入package，其他平台排除
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.9" data-path="../chapter13/运行.html">
            
                <a href="../chapter13/运行.html">
            
                    
                    14.9 运行
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.15" data-path="../chapter14/">
            
                <a href="../chapter14/">
            
                    
                    15.迁移实战
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.15.1" data-path="../chapter14/14.1拨打电话.html">
            
                <a href="../chapter14/14.1拨打电话.html">
            
                    
                    15.1 拨打电话
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.2" data-path="../chapter14/14.2使用url_launcher.html">
            
                <a href="../chapter14/14.2使用url_launcher.html">
            
                    
                    15.2 使用url_launcher
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.3" data-path="../chapter14/14.3flutter开发鸿蒙PC应用.html">
            
                <a href="../chapter14/14.3flutter开发鸿蒙PC应用.html">
            
                    
                    15.3 flutter开发鸿蒙PC应用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4" data-path="../chapter14/14.4探索适用于鸿蒙原生应用的跨平台开发框架.html">
            
                <a href="../chapter14/14.4探索适用于鸿蒙原生应用的跨平台开发框架.html">
            
                    
                    15.4 探索适用于鸿蒙原生应用的跨平台开发框架
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.5" data-path="../chapter14/14.5保存图片.html">
            
                <a href="../chapter14/14.5保存图片.html">
            
                    
                    15.5 保存图片
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.6" data-path="../chapter14/14.6使用url.html">
            
                <a href="../chapter14/14.6使用url.html">
            
                    
                    15.6 使用url
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.7" data-path="../chapter14/今日时鉴.html">
            
                <a href="../chapter14/今日时鉴.html">
            
                    
                    15.7 今日时鉴
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.16" data-path="../chapter15/">
            
                <a href="../chapter15/">
            
                    
                    16.上架审核
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.16.1" data-path="../chapter15/15.1应用上架流程.html">
            
                <a href="../chapter15/15.1应用上架流程.html">
            
                    
                    16.1应用上架流程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.16.2" data-path="../chapter15/15.2审核注意事项.html">
            
                <a href="../chapter15/15.2审核注意事项.html">
            
                    
                    16.2审核注意事项
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.17" data-path="../chapter16/">
            
                <a href="../chapter16/">
            
                    
                    17.FAQ
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.17.1" data-path="../chapter16/16.1ohos应用编译相关问题.html">
            
                <a href="../chapter16/16.1ohos应用编译相关问题.html">
            
                    
                    17.1 ohos应用编译相关问题
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17.2" data-path="../chapter16/16.2原有项目迁移鸿蒙.html">
            
                <a href="../chapter16/16.2原有项目迁移鸿蒙.html">
            
                    
                    17.2 原有项目迁移鸿蒙
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17.3" data-path="../chapter16/16.3权限相关.html">
            
                <a href="../chapter16/16.3权限相关.html">
            
                    
                    17.3 权限相关
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17.4" data-path="../chapter16/16.4Flutter_3.22.0-ohos_0.1.0_Release发布.html">
            
                <a href="../chapter16/16.4Flutter_3.22.0-ohos_0.1.0_Release发布.html">
            
                    
                    17.4 Flutter 3.22.0-ohos 0.1.0 Release发布
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17.5" data-path="../chapter16/16.5环境相关问题.html">
            
                <a href="../chapter16/16.5环境相关问题.html">
            
                    
                    17.5 环境相关问题
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17.6" data-path="../chapter16/16.6ohos代码开发相关问题.html">
            
                <a href="../chapter16/16.6ohos代码开发相关问题.html">
            
                    
                    17.6 ohos代码开发相关问题
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17.7" data-path="../chapter16/16.7解析flutter相关的cppcrash堆栈.html">
            
                <a href="../chapter16/16.7解析flutter相关的cppcrash堆栈.html">
            
                    
                    17.7 解析flutter相关的cppcrash堆栈
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17.8" data-path="../chapter16/16.8ohos引擎产物编译相关问题.html">
            
                <a href="../chapter16/16.8ohos引擎产物编译相关问题.html">
            
                    
                    17.8 ohos引擎产物编译相关问题
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17.9" data-path="../chapter16/ffi.html">
            
                <a href="../chapter16/ffi.html">
            
                    
                    17.9 FFI
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17.10" data-path="../chapter16/三方库相关.html">
            
                <a href="../chapter16/三方库相关.html">
            
                    
                    17.10 三方库相关
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.18" data-path="../chapter17/">
            
                <a href="../chapter17/">
            
                    
                    18.阅读更多
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.18.1" data-path="../chapter17/17.1版本.html">
            
                <a href="../chapter17/17.1版本.html">
            
                    
                    18.1 适配HarmonyOS Next API16的鸿蒙版Flutter 3.22.0版本发布
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.18.2" data-path="../chapter17/17.2平台判断与问题处理指南.html">
            
                <a href="../chapter17/17.2平台判断与问题处理指南.html">
            
                    
                    18.2 平台判断与问题处理指南
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.18.3" data-path="../chapter17/17.3鸿蒙版Flutter_3.22.0版本正式发布(1.0Release">
            
                <span>
            
                    
                    18.3 鸿蒙版Flutter 3.22.0版本正式发布(1.0Release)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.18.4" data-path="../chapter17/17.4优化_ohos_构建过程.html">
            
                <a href="../chapter17/17.4优化_ohos_构建过程.html">
            
                    
                    18.4 优化ohos构建过程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.18.5" data-path="../chapter17/17.5新增use-application-binary命令.html">
            
                <a href="../chapter17/17.5新增use-application-binary命令.html">
            
                    
                    18.5 新增use-application-binary命令
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.18.6" data-path="../chapter17/17.6Flutter_3.22.0-ohos_1.0.1_Release发布.md">
            
                <span>
            
                    
                    18.6 Flutter 3.22.0-ohos 1.0.1 Release发布
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.18.7" data-path="../chapter17/17.7关于插件参数传递.html">
            
                <a href="../chapter17/17.7关于插件参数传递.html">
            
                    
                    18.7 关于插件参数传递
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.18.8" data-path="../chapter17/17.8关于鸿蒙版Flutter的_context_.html">
            
                <a href="../chapter17/17.8关于鸿蒙版Flutter的_context_.html">
            
                    
                    18.8 关于鸿蒙版Flutter的context
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.18.9" data-path="../chapter17/5.1API_18正式发布.html">
            
                <a href="../chapter17/5.1API_18正式发布.html">
            
                    
                    18.9 5.1API 18正式发布
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.18.10" data-path="../chapter17/5.1完整.html">
            
                <a href="../chapter17/5.1完整.html">
            
                    
                    18.10 5.1完整
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.19" data-path="../chapter18/">
            
                <a href="../chapter18/">
            
                    
                    19.多设备能力
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.19.1" data-path="../chapter18/18.1多设备自适应布局.html">
            
                <a href="../chapter18/18.1多设备自适应布局.html">
            
                    
                    19.1 自适应布局
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.19.2" data-path="../chapter18/18.2多设备响应式布局.html">
            
                <a href="../chapter18/18.2多设备响应式布局.html">
            
                    
                    19.2 响应式布局
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.19.3" data-path="../chapter18/18.3多设备典型布局场景.html">
            
                <a href="../chapter18/18.3多设备典型布局场景.html">
            
                    
                    19.3 典型布局场景
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.19.4" data-path="../chapter18/18.4交互归一能力.html">
            
                <a href="../chapter18/18.4交互归一能力.html">
            
                    
                    19.4 交互归一能力
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.20" data-path="../chapter19/README.md">
            
                <span>
            
                    
                    20.关于未来
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.21" data-path="../chapter20/">
            
                <a href="../chapter20/">
            
                    
                    21.版本更新
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.21.1" data-path="../chapter20/20.1鸿蒙版Flutter_3.22.0版本正式发布(1.0Release">
            
                <span>
            
                    
                    21.1 鸿蒙版Flutter 3.22.0版本正式发布(1.0Release)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.21.2" data-path="../chapter20/20.2Flutter_3.22.0-ohos_1.0.1_Release发布.html">
            
                <a href="../chapter20/20.2Flutter_3.22.0-ohos_1.0.1_Release发布.html">
            
                    
                    21.2 Flutter 3.22.0-ohos 1.0.1 Release发布
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.21.3" data-path="../chapter20/20.3发布新版本.html">
            
                <a href="../chapter20/20.3发布新版本.html">
            
                    
                    21.3 发布新版本
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.21.4" data-path="../chapter20/20.4Flutter3.22.0-ohos-1.0.4发布.html">
            
                <a href="../chapter20/20.4Flutter3.22.0-ohos-1.0.4发布.html">
            
                    
                    21.4 Flutter3.22.0-ohos-1.0.4发布
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.21.5" data-path="../chapter20/20.5如何升级插件升级最新的鸿蒙版_flutter.html">
            
                <a href="../chapter20/20.5如何升级插件升级最新的鸿蒙版_flutter.html">
            
                    
                    21.5 如何升级插件升级最新的鸿蒙版flutter
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.21.6" data-path="../chapter20/20.6各版本的鸿蒙版flutter如何获取.html">
            
                <a href="../chapter20/20.6各版本的鸿蒙版flutter如何获取.html">
            
                    
                    21.6 各版本的鸿蒙版flutter如何获取
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.21.7" data-path="../chapter20/20.7新版本发布.html">
            
                <a href="../chapter20/20.7新版本发布.html">
            
                    
                    21.7 新版本发布
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.22" data-path="../致谢.html">
            
                <a href="../致谢.html">
            
                    
                    致谢
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>

</nav>
     
  </div>

  <!-- Content nav -->
  <div class="book-anchor">
    <div class="book-anchor-title"></div>

    <div class="book-anchor-body"></div>
  </div>

  <div class="book-body">
    
    <div class="body-inner">
       

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >13.4适配三方库之udid</a>
    </h1>
</div>



      <div class="page-wrapper" tabindex="-1" role="main">
        <div class="page-inner">
          
<div class="search-plus" id="book-search-results">
    <div class="search-noresults">
    
          <section class="normal markdown-section">
             <h1 id="flutterudid-&#x4E09;&#x65B9;&#x5E93;&#x9E3F;&#x8499;&#x9002;&#x914D;&#x4E4B;&#x65C5;&#xFF1A;&#x4ECE;&#x96F6;&#x5230;&#x4E00;&#x7684;&#x6DF1;&#x5EA6;&#x5B9E;&#x8DF5;">Flutter_udid &#x4E09;&#x65B9;&#x5E93;&#x9E3F;&#x8499;&#x9002;&#x914D;&#x4E4B;&#x65C5;&#xFF1A;&#x4ECE;&#x96F6;&#x5230;&#x4E00;&#x7684;&#x6DF1;&#x5EA6;&#x5B9E;&#x8DF5;</h1>
<p>&#x5728;&#x6570;&#x5B57;&#x5316;&#x6D6A;&#x6F6E;&#x7684;&#x63A8;&#x52A8;&#x4E0B;&#xFF0C;&#x8DE8;&#x5E73;&#x53F0;&#x5F00;&#x53D1;&#x6846;&#x67B6;&#x5982; Flutter &#x51ED;&#x501F;&#x5176;&#x9AD8;&#x6548;&#x3001;&#x4FBF;&#x6377;&#x7684;&#x7279;&#x6027;&#xFF0C;&#x6210;&#x4E3A;&#x4E86;&#x5F00;&#x53D1;&#x8005;&#x4EEC;&#x7684;&#x5BA0;&#x513F;&#x3002;&#x800C;&#x9E3F;&#x8499;&#x7CFB;&#x7EDF;&#x7684;&#x5D1B;&#x8D77;&#xFF0C;&#x66F4;&#x662F;&#x4E3A;&#x8DE8;&#x5E73;&#x53F0;&#x5F00;&#x53D1;&#x6CE8;&#x5165;&#x4E86;&#x65B0;&#x7684;&#x6D3B;&#x529B;&#x3002;&#x4E3A;&#x4E86;&#x52A9;&#x529B;&#x5F00;&#x53D1;&#x8005;&#x5728;&#x9E3F;&#x8499;&#x751F;&#x6001;&#x4E2D;&#x5FEB;&#x901F;&#x5B9E;&#x73B0; Flutter_udid &#x83B7;&#x53D6;&#x8BBE;&#x5907;&#x6807;&#x8BC6;&#x7B26;&#x529F;&#x80FD;&#xFF0C;&#x672C;&#x6587;&#x5C06;&#x6DF1;&#x5165;&#x6D45;&#x51FA;&#x5730;&#x4E3A;&#x5927;&#x5BB6;&#x89E3;&#x6790;&#x5982;&#x4F55;&#x9002;&#x914D; Flutter_udid &#x4E09;&#x65B9;&#x5E93;&#x81F3;&#x9E3F;&#x8499;&#x5E73;&#x53F0;&#x3002;</p>
<h2 id="&#x4E00;&#x3001;oaid&#x4ECB;&#x7ECD;">&#x4E00;&#x3001;OAID&#x4ECB;&#x7ECD;</h2>
<p>&#x5F00;&#x653E;&#x533F;&#x540D;&#x8BBE;&#x5907;&#x6807;&#x8BC6;&#x7B26;&#xFF08;Open Anonymous Device Identifier, OAID&#xFF0C;&#x4EE5;&#x4E0B;&#x7B80;&#x79F0;OAID&#xFF09;&#xFF1A;&#x662F;&#x4E00;&#x79CD;&#x975E;&#x6C38;&#x4E45;&#x6027;&#x8BBE;&#x5907;&#x6807;&#x8BC6;&#x7B26;&#xFF0C;&#x57FA;&#x4E8E;&#x5F00;&#x653E;&#x533F;&#x540D;&#x8BBE;&#x5907;&#x6807;&#x8BC6;&#x7B26;&#xFF0C;OAID&#x662F;&#x57FA;&#x4E8E;&#x534E;&#x4E3A;&#x81EA;&#x6709;&#x7B97;&#x6CD5;&#x751F;&#x6210;&#x7684;32&#x4F4D;&#x7C7B;UUID&#xFF08;Universally Unique Identifier&#xFF09;&#x6807;&#x8BC6;&#x7B26;&#xFF0C;&#x683C;&#x5F0F;&#x4E3A;xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&#x3002;</p>
<h3 id="oaid&#x7684;&#x7279;&#x6027;&#xFF1A;">OAID&#x7684;&#x7279;&#x6027;&#xFF1A;</h3>
<ul>
<li>OAID&#x662F;&#x8BBE;&#x5907;&#x7EA7;&#x6807;&#x8BC6;&#x7B26;&#xFF0C;&#x540C;&#x4E00;&#x53F0;&#x8BBE;&#x5907;&#x4E0A;&#x4E0D;&#x540C;&#x7684;App&#x83B7;&#x53D6;&#x5230;&#x7684;OAID&#x503C;&#x4E00;&#x6837;&#x3002;</li>
<li>OAID&#x7684;&#x83B7;&#x53D6;&#x53D7;&#x5E94;&#x7528;&#x7684;&#x201C;&#x8DE8;&#x5E94;&#x7528;&#x5173;&#x8054;&#x8BBF;&#x95EE;&#x6743;&#x9650;&#x201D;&#x5F00;&#x5173;&#x5F71;&#x54CD;&#xFF1A;&#x5F53;&#x5E94;&#x7528;&#x7684;&#x201C;&#x8DE8;&#x5E94;&#x7528;&#x5173;&#x8054;&#x8BBF;&#x95EE;&#x6743;&#x9650;&#x201D;&#x5F00;&#x5173;&#x5F00;&#x542F;&#x65F6;&#xFF0C;&#x8BE5;&#x5E94;&#x7528;&#x53EF;&#x83B7;&#x53D6;&#x5230;&#x975E;&#x5168;0&#x7684;&#x6709;&#x6548;OAID&#xFF1B;&#x5F53;&#x5E94;&#x7528;&#x7684;&#x201C;&#x8DE8;&#x5E94;&#x7528;&#x5173;&#x8054;&#x8BBF;&#x95EE;&#x6743;&#x9650;&#x201D;&#x5F00;&#x5173;&#x5173;&#x95ED;&#x65F6;&#xFF0C;&#x8BE5;&#x5E94;&#x7528;&#x4EC5;&#x80FD;&#x83B7;&#x53D6;&#x5230;&#x5168;0&#x7684;OAID&#x3002;</li>
<li>&#x540C;&#x4E00;&#x53F0;&#x8BBE;&#x5907;&#x4E0A;&#x9996;&#x4E2A;&#x5E94;&#x7528;&#x5F00;&#x542F;&#x5E94;&#x7528;&#x201C;&#x8DE8;&#x5E94;&#x7528;&#x5173;&#x8054;&#x8BBF;&#x95EE;&#x6743;&#x9650;&#x201D;&#x5F00;&#x5173;&#x65F6;&#xFF0C;&#x4F1A;&#x9996;&#x6B21;&#x751F;&#x6210;OAID</li>
</ul>
<p>OAID&#x4F1A;&#x5728;&#x4E0B;&#x8FF0;&#x573A;&#x666F;&#x4E2D;&#x53D1;&#x751F;&#x53D8;&#x5316;&#xFF1A;</p>
<ul>
<li>&#x7528;&#x6237;&#x6062;&#x590D;&#x624B;&#x673A;&#x51FA;&#x5382;&#x8BBE;&#x7F6E;&#x3002;</li>
<li>&#x7528;&#x6237;&#x64CD;&#x4F5C;&#x91CD;&#x7F6E;OAID&#x3002;</li>
</ul>
<h3 id="&#x9E3F;&#x8499;&#x539F;&#x751F;&#x5F00;&#x53D1;&#x6B65;&#x9AA4;">&#x9E3F;&#x8499;&#x539F;&#x751F;&#x5F00;&#x53D1;&#x6B65;&#x9AA4;</h3>
<p>&#x5728;&#x6A21;&#x5757;&#x7684;module.json5&#x6587;&#x4EF6;&#x4E2D;&#xFF0C;&#x7533;&#x8BF7;&#x5E7F;&#x544A;&#x8DDF;&#x8E2A;&#x6743;&#x9650;<a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V14/permissions-for-all-user-V14#ohospermissionapp_tracking_consent" target="_blank">ohos.permission.APP_TRACKING_CONSENT</a>&#xFF0C;&#x8BE5;&#x6743;&#x9650;&#x4E3A;user_grant&#x6743;&#x9650;&#xFF0C;&#x5F53;&#x7533;&#x8BF7;&#x7684;&#x6743;&#x9650;&#x4E3A;user_grant&#x6743;&#x9650;&#x65F6;&#xFF0C;reason&#xFF0C;abilities&#x6807;&#x7B7E;&#x5FC5;&#x586B;&#xFF0C;&#x914D;&#x7F6E;&#x65B9;&#x5F0F;&#x53C2;&#x89C1;<a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V14/declare-permissions-V14#&#x5728;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x4E2D;&#x58F0;&#x660E;&#x6743;&#x9650;" target="_blank">requestPermissions&#x6807;&#x7B7E;&#x8BF4;&#x660E;</a>&#xFF0C;&#x793A;&#x4F8B;&#x4EE3;&#x7801;&#x5982;&#x4E0B;&#x6240;&#x793A;&#xFF1A;</p>
<pre><code>{
  &quot;module&quot;: {
    &quot;requestPermissions&quot;: [
      {
        &quot;name&quot;: &quot;ohos.permission.APP_TRACKING_CONSENT&quot;,
        &quot;reason&quot;: &quot;$string:reason&quot;,
        &quot;usedScene&quot;: {
          &quot;abilities&quot;: [
            &quot;EntryFormAbility&quot;
          ],
          &quot;when&quot;: &quot;inuse&quot;
        }
      }
    ]
  }
}
</code></pre><p>&#x5E94;&#x7528;&#x5728;&#x9700;&#x8981;&#x83B7;&#x53D6;OAID&#x4FE1;&#x606F;&#x65F6;&#xFF0C;&#x5E94;&#x901A;&#x8FC7;&#x8C03;&#x7528;requestPermissionsFromUser&#x63A5;&#x53E3;&#x83B7;&#x53D6;&#x5BF9;&#x5E94;&#x6743;&#x9650;&#x3002;&#x6CE8;&#x610F;&#xFF1A;&#x5176;&#x4E2D;context&#x7684;&#x83B7;&#x53D6;&#x65B9;&#x5F0F;&#x53C2;&#x89C1;<a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V14/js-apis-inner-application-context-V14" target="_blank">&#x5404;&#x7C7B;Context&#x7684;&#x83B7;&#x53D6;&#x65B9;&#x5F0F;</a>&#x3002;&#x793A;&#x4F8B;&#x4EE3;&#x7801;&#x5982;&#x4E0B;&#x6240;&#x793A;&#xFF1A;</p>
<pre><code>import { identifier } from &apos;@kit.AdsKit&apos;;
import { abilityAccessCtrl, common } from &apos;@kit.AbilityKit&apos;;
import { hilog } from &apos;@kit.PerformanceAnalysisKit&apos;;
import { BusinessError } from &apos;@kit.BasicServicesKit&apos;;

function requestOAIDTrackingConsentPermissions(context: common.Context): void {
  // &#x8FDB;&#x5165;&#x9875;&#x9762;&#x65F6;&#xFF0C;&#x5411;&#x7528;&#x6237;&#x8BF7;&#x6C42;&#x6388;&#x6743;&#x5E7F;&#x544A;&#x8DE8;&#x5E94;&#x7528;&#x5173;&#x8054;&#x8BBF;&#x95EE;&#x6743;&#x9650;
  const atManager: abilityAccessCtrl.AtManager = abilityAccessCtrl.createAtManager();
  try {
    atManager.requestPermissionsFromUser(context, [&quot;ohos.permission.APP_TRACKING_CONSENT&quot;]).then((data) =&gt; {
      if (data.authResults[0] === 0) {
        hilog.info(0x0000, &apos;testTag&apos;, &apos;%{public}s&apos;, &apos;succeeded in requesting permission&apos;);
        identifier.getOAID((err: BusinessError, data: string) =&gt; {
          if (err.code) {
            hilog.error(0x0000, &apos;testTag&apos;, &apos;%{public}s&apos;, `get oaid failed, error: ${err.code} ${err.message}`);
          } else {
            const oaid: string = data;
            hilog.info(0x0000, &apos;testTag&apos;, &apos;%{public}s&apos;, `succeeded in getting oaid by callback , oaid: ${oaid}`);
          }
        });
      } else {
        hilog.error(0x0000, &apos;testTag&apos;, &apos;%{public}s&apos;, &apos;user rejected&apos;);
      }
    }).catch((err: BusinessError) =&gt; {
      hilog.error(0x0000, &apos;testTag&apos;, &apos;%{public}s&apos;, `request permission failed, error: ${err.code} ${err.message}`);
    })
  } catch (err) {
    hilog.error(0x0000, &apos;testTag&apos;, &apos;%{public}s&apos;, `catch err-&gt;${err.code}, ${err.message}`);
  }
}
</code></pre><p>&#x4ECA;&#x5929;&#x6211;&#x4EEC;&#x4E00;&#x8D77;&#x6765;&#x770B;&#x4E00;&#x4E0B;&#x5982;&#x4F55;&#x9002;&#x914D;&#x4E0E;&#x4F7F;&#x7528;&#x8FD9;&#x4E2A;&#x4E09;&#x65B9;&#x5E93;</p>
<h2 id="&#x4E8C;&#x3001;flutterudid&#x4ECB;&#x7ECD;">&#x4E8C;&#x3001;flutter_udid&#x4ECB;&#x7ECD;</h2>
<p><code>flutter_udid</code> &#x662F;&#x4E00;&#x4E2A; Flutter &#x63D2;&#x4EF6;&#xFF0C;&#x7528;&#x4E8E;&#x5728; iOS&#x3001;Android&#x3001;Mac&#x3001;Windows &#x548C; Linux &#x5E73;&#x53F0;&#x4E0A;&#x68C0;&#x7D22;&#x8DE8;&#x5E94;&#x7528;&#x91CD;&#x65B0;&#x5B89;&#x88C5;&#x7684;&#x6301;&#x4E45;&#x6027;&#x552F;&#x4E00;&#x8BBE;&#x5907;&#x6807;&#x8BC6;&#x7B26; (UDID)&#x3002;&#x5B83;&#x7684;&#x4E3B;&#x8981;&#x7279;&#x70B9;&#x662F;&#x63D0;&#x4F9B;&#x4E00;&#x79CD;&#x65B9;&#x6CD5;&#x6765;&#x751F;&#x6210;&#x548C;&#x5B58;&#x50A8;&#x8BBE;&#x5907;&#x7684;&#x552F;&#x4E00;&#x6807;&#x8BC6;&#x7B26;&#xFF0C;&#x5373;&#x4F7F;&#x5728;&#x5378;&#x8F7D;&#x5E94;&#x7528;&#x540E;&#xFF0C;&#x4ECD;&#x7136;&#x80FD;&#x4FDD;&#x6301;&#x4E00;&#x81F4;&#x3002;&#x4ECA;&#x5929;&#x6211;&#x4EEC;&#x4F1A;&#x9002;&#x914D;&#x652F;&#x6301;&#x9E3F;&#x8499;&#x3002;</p>
<h2 id="&#x4E09;&#x3001;&#x63D2;&#x4EF6;&#x5E93;&#x4F7F;&#x7528;">&#x4E09;&#x3001;&#x63D2;&#x4EF6;&#x5E93;&#x4F7F;&#x7528;</h2>
<p>&#x9002;&#x914D; OpenHarmony &#x5E73;&#x53F0;&#x7684;&#x8BE6;&#x7EC6;&#x4F7F;&#x7528;&#x6307;&#x5BFC;&#x53EF;&#x4EE5;&#x53C2;&#x8003;&#xFF1A;<a href="https://gitcode.com/openharmony-sig/flutter_samples/blob/master/ohos/docs/07_plugin/ohos%E5%B9%B3%E5%8F%B0%E9%80%82%E9%85%8Dflutter%E4%B8%89%E6%96%B9%E5%BA%93%E6%8C%87%E5%AF%BC.md" target="_blank">Flutter&#x4F7F;&#x7528;&#x6307;&#x5BFC;&#x6587;&#x6863;</a></p>
<p>&#x5728;&#x9879;&#x76EE;&#x4E2D;&#x4F7F;&#x7528;&#x8BE5;&#x63D2;&#x4EF6;&#x5E93;&#x65F6;&#xFF0C;&#x53EA;&#x9700;&#x5728; <code>pubspec.yaml</code> &#x6587;&#x4EF6;&#x7684; <code>dependencies</code> &#x4E2D;&#x65B0;&#x589E;&#x5982;&#x4E0B;&#x914D;&#x7F6E;&#xFF1A;</p>
<pre><code class="lang-yaml"><span class="hljs-attr">dependencies:</span>
<span class="hljs-attr">  flutter_udid:</span>
<span class="hljs-attr">    git:</span>
<span class="hljs-attr">      url:</span> <span class="hljs-string">&quot;https://gitcode.com/nutpi/flutter_udid.git&quot;</span>
<span class="hljs-attr">      path:</span> <span class="hljs-string">&quot;&quot;</span>
</code></pre>
<p>&#x7136;&#x540E;&#x5728;&#x9879;&#x76EE;&#x6839;&#x76EE;&#x5F55;&#x8FD0;&#x884C; <code>flutter pub get</code>&#xFF0C;&#x5373;&#x53EF;&#x5B8C;&#x6210;&#x4F9D;&#x8D56;&#x6DFB;&#x52A0;</p>
<p>&#x63A5;&#x4E0B;&#x6765;&#x662F;&#x5177;&#x4F53;&#x7684;&#x9002;&#x914D;&#x8FC7;&#x7A0B;&#x3002;</p>
<h2 id="&#x56DB;&#x3001;&#x9002;&#x914D;&#x8FC7;&#x7A0B;&#x8BE6;&#x89E3;">&#x56DB;&#x3001;&#x9002;&#x914D;&#x8FC7;&#x7A0B;&#x8BE6;&#x89E3;</h2>
<h3 id="&#xFF08;&#x4E00;&#xFF09;&#x51C6;&#x5907;&#x5DE5;&#x4F5C;">&#xFF08;&#x4E00;&#xFF09;&#x51C6;&#x5907;&#x5DE5;&#x4F5C;</h3>
<p>&#x786E;&#x4FDD;&#x5DF2;&#x7ECF;&#x914D;&#x7F6E;&#x597D;&#x4E86; Flutter &#x5F00;&#x53D1;&#x73AF;&#x5883;&#xFF0C;&#x5177;&#x4F53;&#x53EF;&#x53C2;&#x8003; <a href="https://gitcode.com/openharmony-tpc/flutter_flutter/blob/master/README.md" target="_blank">Flutter &#x914D;&#x7F6E;&#x6307;&#x5357;</a>&#x3002;&#x540C;&#x65F6;&#xFF0C;&#x4ECE; <a href="https://pub.dev/" target="_blank">&#x5B98;&#x65B9;&#x63D2;&#x4EF6;&#x5E93;</a> &#x4E0B;&#x8F7D;&#x5F85;&#x9002;&#x914D;&#x7684;&#x4E09;&#x65B9;&#x63D2;&#x4EF6;&#x3002;&#x672C;&#x6307;&#x5BFC;&#x4E66;&#xFF0C; &#x4EE5;&#x9002;&#x914D; <a href="https://pub-web.flutter-io.cn/packages/flutter_udid/versions/4.0.0" target="_blank">fflutter_udid4.0.0</a> &#x4E3A;&#x4F8B;</p>
<h3 id="&#xFF08;&#x4E8C;&#xFF09;&#x63D2;&#x4EF6;&#x76EE;&#x5F55;&#x7ED3;&#x6784;">&#xFF08;&#x4E8C;&#xFF09;&#x63D2;&#x4EF6;&#x76EE;&#x5F55;&#x7ED3;&#x6784;</h3>
<p>&#x4E0B;&#x8F7D;&#x5E76;&#x89E3;&#x538B;&#x63D2;&#x4EF6;&#x540E;&#xFF0C;&#x6211;&#x4EEC;&#x4F1A;&#x770B;&#x5230;&#x4EE5;&#x4E0B;&#x76EE;&#x5F55;&#x7ED3;&#x6784;&#xFF1A;</p>
<ul>
<li><strong>lib</strong> &#xFF1A;&#x5BF9;&#x63A5; Dart &#x7AEF;&#x4EE3;&#x7801;&#x7684;&#x5165;&#x53E3;&#xFF0C;&#x7531;&#x6B64;&#x6587;&#x4EF6;&#x63A5;&#x6536;&#x5230;&#x53C2;&#x6570;&#x540E;&#xFF0C;&#x901A;&#x8FC7; channel &#x5C06;&#x6570;&#x636E;&#x53D1;&#x9001;&#x5230;&#x539F;&#x751F;&#x7AEF;&#x3002;</li>
<li><strong>android</strong> &#xFF1A;&#x5B89;&#x5353;&#x7AEF;&#x4EE3;&#x7801;&#x5B9E;&#x73B0;&#x76EE;&#x5F55;&#x3002;</li>
<li><strong>ios</strong> &#xFF1A;iOS &#x539F;&#x751F;&#x7AEF;&#x5B9E;&#x73B0;&#x76EE;&#x5F55;&#x3002;</li>
<li><strong>example</strong> &#xFF1A;&#x4E00;&#x4E2A;&#x4F9D;&#x8D56;&#x4E8E;&#x8BE5;&#x63D2;&#x4EF6;&#x7684; Flutter &#x5E94;&#x7528;&#x7A0B;&#x5E8F;&#xFF0C;&#x7528;&#x4E8E;&#x8BF4;&#x660E;&#x5982;&#x4F55;&#x4F7F;&#x7528;&#x5B83;&#x3002;</li>
<li><strong>README.md</strong> &#xFF1A;&#x4ECB;&#x7ECD;&#x5305;&#x7684;&#x6587;&#x4EF6;&#x3002;</li>
<li><strong>CHANGELOG.md</strong> &#xFF1A;&#x8BB0;&#x5F55;&#x6BCF;&#x4E2A;&#x7248;&#x672C;&#x4E2D;&#x7684;&#x66F4;&#x6539;&#x3002;</li>
<li><strong>LICENSE</strong> &#xFF1A;&#x5305;&#x542B;&#x8F6F;&#x4EF6;&#x5305;&#x8BB8;&#x53EF;&#x6761;&#x6B3E;&#x7684;&#x6587;&#x4EF6;&#x3002;</li>
</ul>
<h3 id="&#xFF08;&#x4E09;&#xFF09;&#x521B;&#x5EFA;&#x63D2;&#x4EF6;&#x7684;&#x9E3F;&#x8499;&#x6A21;&#x5757;">&#xFF08;&#x4E09;&#xFF09;&#x521B;&#x5EFA;&#x63D2;&#x4EF6;&#x7684;&#x9E3F;&#x8499;&#x6A21;&#x5757;</h3>
<p>&#x5728;&#x63D2;&#x4EF6;&#x76EE;&#x5F55;&#x4E0B;&#xFF0C;&#x6253;&#x5F00; Terminal&#xFF0C;&#x6267;&#x884C;&#x4EE5;&#x4E0B;&#x547D;&#x4EE4;&#x6765;&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x9E3F;&#x8499;&#x5E73;&#x53F0;&#x7684; Flutter &#x6A21;&#x5757;&#xFF1A;</p>
<pre><code>flutter create . --template=plugin --platforms=ohos
</code></pre><p>&#x6B65;&#x9AA4;&#xFF1A;</p>
<ol>
<li><p>&#x7528;vscode/trae&#x6253;&#x5F00;&#x521A;&#x521A;&#x4E0B;&#x8F7D;&#x597D;&#x7684;&#x63D2;&#x4EF6;&#x3002;</p>
</li>
<li><p>&#x6253;&#x5F00;Terminal&#xFF0C;cd&#x5230;&#x63D2;&#x4EF6;&#x76EE;&#x5F55;&#x4E0B;&#x3002;</p>
</li>
<li><p>&#x6267;&#x884C;&#x547D;&#x4EE4;<code>flutter create . --template=plugin --platforms=ohos</code> &#x521B;&#x5EFA;&#x4E00;&#x4E2A;ohos&#x5E73;&#x53F0;&#x7684;flutter&#x6A21;&#x5757;&#x3002;</p>
</li>
</ol>
<h3 id="&#xFF08;&#x56DB;&#xFF09;&#x5728;&#x6839;&#x76EE;&#x5F55;&#x4E0B;&#x6DFB;&#x52A0;&#x9E3F;&#x8499;&#x5E73;&#x53F0;&#x914D;&#x7F6E;">&#xFF08;&#x56DB;&#xFF09;&#x5728;&#x6839;&#x76EE;&#x5F55;&#x4E0B;&#x6DFB;&#x52A0;&#x9E3F;&#x8499;&#x5E73;&#x53F0;&#x914D;&#x7F6E;</h3>
<p>&#x5728;&#x9879;&#x76EE;&#x6839;&#x76EE;&#x5F55;&#x7684; <code>pubspec.yaml</code> &#x6587;&#x4EF6;&#x4E2D;&#xFF0C;&#x6DFB;&#x52A0;&#x9E3F;&#x8499;&#x5E73;&#x53F0;&#x7684;&#x76F8;&#x5173;&#x914D;&#x7F6E;&#xFF1A;</p>
<pre><code class="lang-yaml"><span class="hljs-attr">name:</span> flutter_udid
<span class="hljs-attr">description:</span> Plugin to retrieve a persistent UDID across reinstalls on iOS and Android
<span class="hljs-attr">version:</span> <span class="hljs-number">4.0</span><span class="hljs-number">.0</span>
<span class="hljs-attr">homepage:</span> https://github.com/GigaDroid/flutter_udid

<span class="hljs-attr">environment:</span>
<span class="hljs-attr">  sdk:</span> <span class="hljs-string">&quot;&gt;=3.0.0 &lt;4.0.0&quot;</span>
<span class="hljs-attr">  flutter:</span> <span class="hljs-string">&quot;&gt;=3.10.0&quot;</span>

<span class="hljs-attr">dependencies:</span>
<span class="hljs-attr">  flutter:</span>
<span class="hljs-attr">    sdk:</span> flutter
<span class="hljs-attr">  crypto:</span> ^<span class="hljs-number">3.0</span><span class="hljs-number">.0</span>

<span class="hljs-attr">dev_dependencies:</span>
<span class="hljs-attr">  flutter_test:</span>
<span class="hljs-attr">    sdk:</span> flutter
<span class="hljs-attr">  flutter_lints:</span> ^<span class="hljs-number">4.0</span><span class="hljs-number">.0</span>

<span class="hljs-attr">flutter:</span>
<span class="hljs-attr">  plugin:</span>
<span class="hljs-attr">    platforms:</span>
<span class="hljs-attr">      android:</span>
<span class="hljs-attr">        package:</span> de.gigadroid.flutter_udid
<span class="hljs-attr">        pluginClass:</span> FlutterUdidPlugin
<span class="hljs-attr">      ios:</span>
<span class="hljs-attr">        pluginClass:</span> FlutterUdidPlugin
<span class="hljs-attr">      macos:</span>
<span class="hljs-attr">        pluginClass:</span> FlutterUdidPlugin
<span class="hljs-attr">      windows:</span>
<span class="hljs-attr">        pluginClass:</span> FlutterUdidPluginCApi
<span class="hljs-attr">      linux:</span>
<span class="hljs-attr">        pluginClass:</span> FlutterUdidPlugin
<span class="hljs-attr">      ohos:</span>
<span class="hljs-attr">        pluginClass:</span> FlutterUdidPlugin
</code></pre>
<h3 id="&#xFF08;&#x4E94;&#xFF09;&#x7F16;&#x5199;&#x9E3F;&#x8499;&#x63D2;&#x4EF6;&#x7684;&#x539F;&#x751F;-ets-&#x6A21;&#x5757;">&#xFF08;&#x4E94;&#xFF09;&#x7F16;&#x5199;&#x9E3F;&#x8499;&#x63D2;&#x4EF6;&#x7684;&#x539F;&#x751F; ETS &#x6A21;&#x5757;</h3>
<h4 id="1-&#x521B;&#x5EFA;&#x9E3F;&#x8499;&#x63D2;&#x4EF6;&#x6A21;&#x5757;">1. &#x521B;&#x5EFA;&#x9E3F;&#x8499;&#x63D2;&#x4EF6;&#x6A21;&#x5757;</h4>
<p>&#x4F7F;&#x7528; DevEco Studio &#x6253;&#x5F00;&#x9E3F;&#x8499;&#x9879;&#x76EE;&#x3002;</p>
<h4 id="2-&#x4FEE;&#x6539;&#x76F8;&#x5173;&#x914D;&#x7F6E;&#x6587;&#x4EF6;">2. &#x4FEE;&#x6539;&#x76F8;&#x5173;&#x914D;&#x7F6E;&#x6587;&#x4EF6;</h4>
<p>&#x5728; <code>ohos</code> &#x76EE;&#x5F55;&#x5185;&#x7684; <code>oh-package.json5</code> &#x6587;&#x4EF6;&#x4E2D;&#x6DFB;&#x52A0; <code>libs/flutter.har</code> &#x4F9D;&#x8D56;&#xFF0C;&#x5E76;&#x521B;&#x5EFA; <code>.gitignore</code> &#x6587;&#x4EF6;&#xFF0C;&#x6DFB;&#x52A0;&#x4EE5;&#x4E0B;&#x5185;&#x5BB9;&#x4EE5;&#x5FFD;&#x7565; <code>libs</code> &#x76EE;&#x5F55;&#xFF1A;</p>
<pre><code class="lang-json">/node_modules
/oh_modules
/local.properties
/.preview
/.idea
/build
/libs
/.cxx
/.test
*.har
/BuildProfile.ets
/oh-package-lock.json5
</code></pre>
<p><code>oh-package.json5</code> &#x6587;&#x4EF6;&#x5185;&#x5BB9;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code class="lang-json">{
  <span class="hljs-string">&quot;name&quot;</span>: <span class="hljs-string">&quot;flutter_udid&quot;</span>,
  <span class="hljs-string">&quot;version&quot;</span>: <span class="hljs-string">&quot;1.0.0&quot;</span>,
  <span class="hljs-string">&quot;description&quot;</span>: <span class="hljs-string">&quot;Plugin to retrieve a persistent UDID accross reinstalls on HarmonyOS and OpenHarmony&quot;</span>,
  <span class="hljs-string">&quot;main&quot;</span>: <span class="hljs-string">&quot;index.ets&quot;</span>,
  <span class="hljs-string">&quot;author&quot;</span>: <span class="hljs-string">&quot;nutpi&quot;</span>,
  <span class="hljs-string">&quot;license&quot;</span>: <span class="hljs-string">&quot;Apache-2.0&quot;</span>,
  <span class="hljs-string">&quot;dependencies&quot;</span>: {
    <span class="hljs-string">&quot;@ohos/flutter_ohos&quot;</span>: <span class="hljs-string">&quot;file:./libs/flutter.har&quot;</span>
  },
  <span class="hljs-string">&quot;modelVersion&quot;</span>: <span class="hljs-string">&quot;5.0.4&quot;</span>
}
</code></pre>
<p>&#x5728; <code>ohos</code> &#x76EE;&#x5F55;&#x4E0B;&#x521B;&#x5EFA; <code>index.ets</code> &#x6587;&#x4EF6;&#xFF0C;&#x5BFC;&#x51FA;&#x914D;&#x7F6E;&#xFF1A;</p>
<pre><code>


import FlutterUdidPlugin from &apos;./src/main/ets/de/gigadroid/flutter_udid/FlutterUdidPlugin&apos;

export default FlutterUdidPlugin
</code></pre><h4 id="3-&#x7F16;&#x5199;-ets-&#x4EE3;&#x7801;">3. &#x7F16;&#x5199; ETS &#x4EE3;&#x7801;</h4>
<p>&#x6587;&#x4EF6;&#x7ED3;&#x6784;&#x548C;&#x4EE3;&#x7801;&#x903B;&#x8F91;&#x53EF;&#x4EE5;&#x53C2;&#x8003;&#x5B89;&#x5353;&#x6216; iOS &#x7684;&#x5B9E;&#x73B0;&#xFF0C;&#x9E3F;&#x8499;&#x7684; API &#x6587;&#x6863;&#x53EF;&#x4EE5;&#x53C2;&#x8003; &#xFF1A;<a href="https://gitcode.com/openharmony-sig/flutter_packages/tree/master/packages/path_provider/path_provider_android" target="_blank">https://gitcode.com/openharmony-sig/flutter_packages/tree/master/packages/path_provider/path_provider_android</a></p>
<p>ohos&#x7684;api&#x53EF;&#x4EE5;&#x53C2;&#x8003;&#xFF1A;<a href="https://gitcode.com/openharmony/docs" target="_blank">https://gitcode.com/openharmony/docs</a></p>
<p>&#x4EE5;&#x4E0B;&#x662F; <code>FlutterUdidPlugin.ets</code> &#x6587;&#x4EF6;&#x7684;&#x4EE3;&#x7801;&#x793A;&#x4F8B;&#xFF1A;</p>
<pre><code class="lang-js">

<span class="hljs-keyword">import</span> {
  MethodCallHandler,
  FlutterPlugin,
  BinaryMessenger,
  FlutterPluginBinding,
  AbilityPluginBinding,
  MethodCall,
  MethodChannel,
  MethodResult,
  Log
} <span class="hljs-keyword">from</span> <span class="hljs-string">&apos;@ohos/flutter_ohos&apos;</span>;
<span class="hljs-keyword">import</span> {  common } <span class="hljs-keyword">from</span> <span class="hljs-string">&apos;@kit.AbilityKit&apos;</span>;
<span class="hljs-keyword">import</span> { identifier } <span class="hljs-keyword">from</span> <span class="hljs-string">&apos;@kit.AdsKit&apos;</span>;
<span class="hljs-keyword">import</span> { UIAbility } <span class="hljs-keyword">from</span> <span class="hljs-string">&apos;@kit.AbilityKit&apos;</span>;
<span class="hljs-keyword">import</span> { requestPermissions } <span class="hljs-keyword">from</span> <span class="hljs-string">&apos;./RequestPermissions&apos;</span>;

<span class="hljs-keyword">const</span> TAG: string = <span class="hljs-string">&quot;FlutterUdidPlugin&quot;</span>;

<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">FlutterUdidPlugin</span> <span class="hljs-title">implements</span> <span class="hljs-title">MethodCallHandler</span>, <span class="hljs-title">FlutterPlugin</span> </span>{
  private channel: MethodChannel | <span class="hljs-literal">null</span> = <span class="hljs-literal">null</span>
  private applicationContext: common.Context | <span class="hljs-literal">null</span> = <span class="hljs-literal">null</span>
  private ability: UIAbility | <span class="hljs-literal">null</span> = <span class="hljs-literal">null</span>;

  <span class="hljs-keyword">constructor</span>(context?: common.Context) {
    <span class="hljs-keyword">if</span> (context) {
      <span class="hljs-keyword">this</span>.applicationContext = context;
    }
  }

  <span class="hljs-keyword">static</span> registerWith(): <span class="hljs-keyword">void</span> {
  }

  getUniqueClassName(): string {
    <span class="hljs-keyword">return</span> TAG;
  }

  onAttachedToEngine(binding: FlutterPluginBinding): <span class="hljs-keyword">void</span> {
    <span class="hljs-keyword">this</span>.onAttachedToEngine1(binding.getApplicationContext(), binding.getBinaryMessenger());
  }

  private onAttachedToEngine1(applicationContext: Context, messenger: BinaryMessenger) {
    <span class="hljs-keyword">this</span>.applicationContext = applicationContext;
    <span class="hljs-keyword">this</span>.channel = <span class="hljs-keyword">new</span> MethodChannel(messenger, <span class="hljs-string">&quot;flutter_udid&quot;</span>)
    <span class="hljs-keyword">this</span>.channel.setMethodCallHandler(<span class="hljs-keyword">this</span>)
  }

  onAttachedToAbility(binding: AbilityPluginBinding): <span class="hljs-keyword">void</span> {
    <span class="hljs-keyword">this</span>.ability = binding.getAbility()
  }

  onDetachedFromAbility(): <span class="hljs-keyword">void</span> {
    <span class="hljs-keyword">this</span>.ability = <span class="hljs-literal">null</span>;
  }

  onMethodCall(call: MethodCall, result: MethodResult): <span class="hljs-keyword">void</span> {
    <span class="hljs-keyword">if</span> (call.method == <span class="hljs-string">&quot;getUDID&quot;</span>) {
      <span class="hljs-keyword">this</span>.requestPermissions().then((data: boolean) =&gt; {
        <span class="hljs-keyword">this</span>.getUDID().then((udid: string | <span class="hljs-literal">null</span>) =&gt; {
          <span class="hljs-keyword">if</span> (udid == <span class="hljs-literal">null</span> || udid == <span class="hljs-string">&quot;&quot;</span>) {
            result.error(<span class="hljs-string">&quot;UNAVAILABLE&quot;</span>, <span class="hljs-string">&quot;UDID not available.&quot;</span>, <span class="hljs-literal">null</span>)

          } <span class="hljs-keyword">else</span> {
            result.success(udid)
          }
        })
      })
    } <span class="hljs-keyword">else</span> {
      result.notImplemented()
    }
  }

  onDetachedFromEngine(binding: FlutterPluginBinding): <span class="hljs-keyword">void</span> {
    <span class="hljs-keyword">this</span>.applicationContext = <span class="hljs-literal">null</span>;
    <span class="hljs-keyword">this</span>.channel?.setMethodCallHandler(<span class="hljs-literal">null</span>)
  }

  private <span class="hljs-keyword">async</span> getUDID(): <span class="hljs-built_in">Promise</span>&lt;string | <span class="hljs-literal">null</span>&gt; {
    <span class="hljs-keyword">try</span> {
      <span class="hljs-keyword">return</span> <span class="hljs-keyword">await</span> identifier.getOAID()
    } <span class="hljs-keyword">catch</span> (err) {
      <span class="hljs-keyword">return</span> <span class="hljs-literal">null</span>
    }
  }

  private <span class="hljs-keyword">async</span> requestPermissions(): <span class="hljs-built_in">Promise</span>&lt;boolean&gt; {
    <span class="hljs-keyword">if</span> (!<span class="hljs-keyword">this</span>.ability) {
      Log.i(TAG, <span class="hljs-string">&quot;Could not launch BarcodeScanner because the plugin is not attached to any ability&quot;</span>)
      <span class="hljs-keyword">return</span> <span class="hljs-literal">false</span>
    }
    <span class="hljs-keyword">try</span> {
      <span class="hljs-keyword">const</span> results = <span class="hljs-keyword">await</span> requestPermissions(<span class="hljs-keyword">this</span>.ability!.context)
      <span class="hljs-keyword">return</span> results ? results : <span class="hljs-literal">false</span>
    } <span class="hljs-keyword">catch</span> (e) {
    }
    <span class="hljs-keyword">return</span> <span class="hljs-literal">false</span>
  }
}
</code></pre>
<p>&#x4EE5;&#x4E0B;&#x662F; <code>requestPermissions.ets</code> &#x6587;&#x4EF6;&#x7684;&#x4EE3;&#x7801;&#x793A;&#x4F8B;&#xFF1A;</p>
<pre><code class="lang-js">
<span class="hljs-keyword">import</span> bundleManager <span class="hljs-keyword">from</span> <span class="hljs-string">&apos;@ohos.bundle.bundleManager&apos;</span>;
<span class="hljs-keyword">import</span> abilityAccessCtrl, { Permissions } <span class="hljs-keyword">from</span> <span class="hljs-string">&apos;@ohos.abilityAccessCtrl&apos;</span>;
<span class="hljs-keyword">import</span> { BusinessError } <span class="hljs-keyword">from</span> <span class="hljs-string">&apos;@kit.BasicServicesKit&apos;</span>;

<span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> appTrackingConsentPermission: <span class="hljs-built_in">Array</span>&lt;Permissions&gt; = [<span class="hljs-string">&apos;ohos.permission.APP_TRACKING_CONSENT&apos;</span>];

<span class="hljs-keyword">async</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">checkAccessToken</span>(<span class="hljs-params">permission: Permissions</span>): <span class="hljs-title">Promise</span>&lt;<span class="hljs-title">abilityAccessCtrl</span>.<span class="hljs-title">GrantStatus</span>&gt; </span>{
  <span class="hljs-keyword">let</span> atManager: abilityAccessCtrl.AtManager = abilityAccessCtrl.createAtManager();
  <span class="hljs-keyword">let</span> grantStatus: abilityAccessCtrl.GrantStatus = abilityAccessCtrl.GrantStatus.PERMISSION_DENIED;

  <span class="hljs-comment">// &#x83B7;&#x53D6;&#x5E94;&#x7528;&#x7A0B;&#x5E8F;&#x7684;accessTokenID</span>
  <span class="hljs-keyword">let</span> tokenId: number = <span class="hljs-number">0</span>;
  <span class="hljs-keyword">try</span> {
    <span class="hljs-keyword">let</span> bundleInfo: bundleManager.BundleInfo =
      <span class="hljs-keyword">await</span> bundleManager.getBundleInfoForSelf(bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION);
    <span class="hljs-keyword">let</span> appInfo: bundleManager.ApplicationInfo = bundleInfo.appInfo;
    tokenId = appInfo.accessTokenId;
  } <span class="hljs-keyword">catch</span> (error) {
    <span class="hljs-keyword">let</span> err: BusinessError = error <span class="hljs-keyword">as</span> BusinessError;
    <span class="hljs-built_in">console</span>.error(<span class="hljs-string">`Failed to get bundle info for self. Code is <span class="hljs-subst">${err.code}</span>, message is <span class="hljs-subst">${err.message}</span>`</span>);
  }

  <span class="hljs-comment">// &#x6821;&#x9A8C;&#x5E94;&#x7528;&#x662F;&#x5426;&#x88AB;&#x6388;&#x4E88;&#x6743;&#x9650;</span>
  <span class="hljs-keyword">try</span> {
    grantStatus = <span class="hljs-keyword">await</span> atManager.checkAccessToken(tokenId, permission);
  } <span class="hljs-keyword">catch</span> (error) {
    <span class="hljs-keyword">let</span> err: BusinessError = error <span class="hljs-keyword">as</span> BusinessError;
    <span class="hljs-built_in">console</span>.error(<span class="hljs-string">`Failed to check access token. Code is <span class="hljs-subst">${err.code}</span>, message is <span class="hljs-subst">${err.message}</span>`</span>);
  }

  <span class="hljs-keyword">return</span> grantStatus;
}

<span class="hljs-keyword">export</span> <span class="hljs-keyword">async</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">checkPermissions</span>(<span class="hljs-params">permissions: Array&lt;Permissions&gt;</span>): <span class="hljs-title">Promise</span>&lt;<span class="hljs-title">boolean</span>&gt; </span>{
  <span class="hljs-keyword">let</span> grantStatus: abilityAccessCtrl.GrantStatus = <span class="hljs-keyword">await</span> checkAccessToken(permissions[<span class="hljs-number">0</span>]);
  <span class="hljs-keyword">return</span> grantStatus === abilityAccessCtrl.GrantStatus.PERMISSION_GRANTED;
}

<span class="hljs-keyword">export</span> <span class="hljs-keyword">async</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">requestPermissions</span>(<span class="hljs-params">
  context: Context
</span>) </span>{
  <span class="hljs-keyword">const</span> hasAppTrackingConsentPermission: boolean = <span class="hljs-keyword">await</span> checkPermissions(appTrackingConsentPermission);

  <span class="hljs-keyword">if</span> (!hasAppTrackingConsentPermission) {
    <span class="hljs-keyword">let</span> atManager: abilityAccessCtrl.AtManager = abilityAccessCtrl.createAtManager();

    <span class="hljs-comment">// requestPermissionsFromUser&#x4F1A;&#x5224;&#x65AD;&#x6743;&#x9650;&#x7684;&#x6388;&#x6743;&#x72B6;&#x6001;&#x6765;&#x51B3;&#x5B9A;&#x662F;&#x5426;&#x5524;&#x8D77;&#x5F39;&#x7A97;</span>
    <span class="hljs-keyword">try</span> {
      <span class="hljs-keyword">let</span> data = <span class="hljs-keyword">await</span> atManager.requestPermissionsFromUser(context, appTrackingConsentPermission)
      <span class="hljs-keyword">let</span> grantStatus: <span class="hljs-built_in">Array</span>&lt;number&gt; = data.authResults;
      <span class="hljs-keyword">let</span> length: number = grantStatus.length;
      <span class="hljs-keyword">for</span> (<span class="hljs-keyword">let</span> i = <span class="hljs-number">0</span>; i &lt; length; i++) {
        <span class="hljs-keyword">if</span> (grantStatus[i] !== <span class="hljs-number">0</span>) {
          <span class="hljs-comment">// &#x7528;&#x6237;&#x62D2;&#x7EDD;&#x6388;&#x6743;</span>
          <span class="hljs-keyword">return</span> <span class="hljs-literal">false</span>;
        }
      }
      <span class="hljs-comment">// &#x7528;&#x6237;&#x6388;&#x6743;&#xFF0C;&#x53EF;&#x4EE5;&#x7EE7;&#x7EED;&#x8BBF;&#x95EE;&#x76EE;&#x6807;&#x64CD;&#x4F5C;</span>
      <span class="hljs-keyword">return</span> <span class="hljs-literal">true</span>;
    } <span class="hljs-keyword">catch</span> (error) {
      <span class="hljs-keyword">let</span> err: BusinessError = error <span class="hljs-keyword">as</span> BusinessError;
      <span class="hljs-built_in">console</span>.error(<span class="hljs-string">`Failed to request permissions from user. Code is <span class="hljs-subst">${err.code}</span>, message is <span class="hljs-subst">${err.message}</span>`</span>);
      <span class="hljs-keyword">return</span> <span class="hljs-literal">false</span>;
    }
  } <span class="hljs-keyword">else</span> {
    <span class="hljs-comment">// Permissions already exist. Call the callback with success.</span>
    <span class="hljs-keyword">return</span> <span class="hljs-literal">true</span>;
  }
}
</code></pre>
<h4 id="4-&#x4FEE;&#x6539;-index-&#x6587;&#x4EF6;">4. &#x4FEE;&#x6539; index &#x6587;&#x4EF6;</h4>
<p>&#x5728; <code>ohos</code> &#x76EE;&#x5F55;&#x4E0B;&#x521B;&#x5EFA; <code>index.ets</code> &#x6587;&#x4EF6;&#xFF0C;&#x5BFC;&#x51FA; <code>FlutterToastPlugin</code>&#xFF1A;</p>
<pre><code>

import FlutterUdidPlugin from &apos;./src/main/ets/de/gigadroid/flutter_udid/FlutterUdidPlugin&apos;

export default FlutterUdidPlugin
</code></pre><h3 id="&#xFF08;&#x516D;&#xFF09;&#x7F16;&#x5199;-example">&#xFF08;&#x516D;&#xFF09;&#x7F16;&#x5199; Example</h3>
<h4 id="1-&#x521B;&#x5EFA;-example-&#x5E94;&#x7528;">1. &#x521B;&#x5EFA; Example &#x5E94;&#x7528;</h4>
<p>&#x5728;&#x6700;&#x5F00;&#x59CB;&#x4F7F;&#x7528;</p>
<pre><code>flutter create . --template=plugin --platforms=ohos
</code></pre><p>&#x521B;&#x5EFA;&#x6A21;&#x7248;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x4E5F;&#x4F1A;&#x914D;&#x5957;&#x521B;&#x5EFA;Example</p>
<h4 id="2-&#x7B7E;&#x540D;&#x4E0E;&#x8FD0;&#x884C;">2. &#x7B7E;&#x540D;&#x4E0E;&#x8FD0;&#x884C;</h4>
<p>&#x4F7F;&#x7528; <code>Deveco Studio</code> &#x6253;&#x5F00; <code>example &gt; ohos</code> &#x76EE;&#x5F55;&#xFF0C;&#x5355;&#x51FB; <code>File &gt; Project Structure &gt; Project &gt; Signing Configs</code>&#xFF0C;&#x52FE;&#x9009; <code>Automatically generate signature</code>&#xFF0C;&#x7B49;&#x5F85;&#x81EA;&#x52A8;&#x7B7E;&#x540D;&#x5B8C;&#x6210;&#x3002;&#x7136;&#x540E;&#x8FD0;&#x884C;&#x4EE5;&#x4E0B;&#x547D;&#x4EE4;&#xFF1A;</p>
<pre><code>flutter pub get

 flutter build hap --debug
</code></pre><p>&#x5982;&#x679C;&#x5E94;&#x7528;&#x6B63;&#x5E38;&#x542F;&#x52A8;&#xFF0C;&#x8BF4;&#x660E;&#x63D2;&#x4EF6;&#x9002;&#x914D;&#x6210;&#x529F;&#x3002;&#x5982;&#x679C;&#x6CA1;&#x6709;&#xFF0C;&#x6B22;&#x8FCE;&#x5927;&#x5BB6;&#x8054;&#x7CFB;&#x575A;&#x679C;&#x6D3E;&#x4E00;&#x8D77;&#x652F;&#x6301;&#x3002;</p>
<h2 id="&#x4E94;&#x3001;&#x603B;&#x7ED3;">&#x4E94;&#x3001;&#x603B;&#x7ED3;</h2>
<p>&#x901A;&#x8FC7;&#x4EE5;&#x4E0A;&#x6B65;&#x9AA4;&#xFF0C;&#x6211;&#x4EEC;&#x6210;&#x529F;&#x5730;&#x5C06; Flutterudid &#x4E09;&#x65B9;&#x5E93;&#x9002;&#x914D;&#x5230;&#x4E86;&#x9E3F;&#x8499;&#x5E73;&#x53F0;&#x3002;&#x8FD9;&#x4E2A;&#x8FC7;&#x7A0B;&#x6D89;&#x53CA;&#x5230;&#x4E86;&#x89E3;&#x63D2;&#x4EF6;&#x7684;&#x57FA;&#x672C;&#x4FE1;&#x606F;&#x3001;&#x914D;&#x7F6E;&#x5F00;&#x53D1;&#x73AF;&#x5883;&#x3001;&#x521B;&#x5EFA;&#x9E3F;&#x8499;&#x6A21;&#x5757;&#x3001;&#x7F16;&#x5199;&#x539F;&#x751F;&#x4EE3;&#x7801;&#x4EE5;&#x53CA;&#x6D4B;&#x8BD5;&#x9A8C;&#x8BC1;&#x7B49;&#x591A;&#x4E2A;&#x73AF;&#x8282;&#x3002;&#x5E0C;&#x671B;&#x8FD9;&#x7BC7;&#x535A;&#x5BA2;&#x80FD;&#x591F;&#x5E2E;&#x52A9;&#x5230;&#x9700;&#x8981;&#x8FDB;&#x884C; FlutterToast &#x9E3F;&#x8499;&#x9002;&#x914D;&#x7684;&#x5F00;&#x53D1;&#x8005;&#x4EEC;&#xFF0C;&#x8BA9;&#x5927;&#x5BB6;&#x5728;&#x9E3F;&#x8499;&#x751F;&#x6001;&#x7684;&#x5F00;&#x53D1;&#x4E2D;&#x66F4;&#x52A0;&#x5F97;&#x5FC3;&#x5E94;&#x624B;&#x3002;</p>
<h2 id="&#x516D;&#x3001;&#x53C2;&#x8003;">&#x516D;&#x3001;&#x53C2;&#x8003;</h2>
<ul>
<li><a href="https://gitcode.com/openharmony-sig/flutter_samples/blob/master/ohos/docs/04_development/&#x5982;&#x4F55;&#x4F7F;&#x7528;Flutter&#x4E0E;OpenHarmony&#x901A;&#x4FE1; FlutterChannel.md" target="_blank">&#x5982;&#x4F55;&#x4F7F;&#x7528;Flutter&#x4E0E;OpenHarmony&#x901A;&#x4FE1; FlutterChannel</a></li>
<li><a href="https://gitcode.com/openharmony-sig/flutter_samples/blob/master/ohos/docs/04_development/&#x5982;&#x4F55;&#x4F7F;&#x7528;&#x6DF7;&#x5408;&#x5F00;&#x53D1; module.md" target="_blank">&#x5F00;&#x53D1;module</a></li>
<li><a href="https://gitcode.com/openharmony-sig/flutter_samples/blob/master/ohos/docs/04_development/&#x5F00;&#x53D1;package.md" target="_blank">&#x5F00;&#x53D1;package</a></li>
<li><a href="https://gitcode.com/openharmony-sig/flutter_samples/blob/master/ohos/docs/04_development/&#x5F00;&#x53D1;plugin.md" target="_blank">&#x5F00;&#x53D1;plugin</a></li>
<li><a href="https://gitcode.com/openharmony-sig/flutter_samples/blob/master/ohos/docs/04_development/&#x5F00;&#x53D1;FFI plugin.md" target="_blank">&#x5F00;&#x53D1;FFI plugin</a></li>
<li><a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V14/oaid-service-V14" target="_blank">https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V14/oaid-service-V14</a></li>
<li><a href="https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/reference/apis-ads-kit/js-apis-oaid.md" target="_blank">https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/reference/apis-ads-kit/js-apis-oaid.md</a></li>
</ul>
<h2 id="&#x4E03;&#x3001;&#x575A;&#x679C;&#x6D3E;">&#x4E03;&#x3001;&#x575A;&#x679C;&#x6D3E;</h2>
<p>&#x575A;&#x679C;&#x6D3E;&#x7531;&#x575A;&#x679C;&#x7B49;&#x4EBA;&#x521B;&#x5EFA;&#xFF0C;&#x56E2;&#x961F;&#x62E5;&#x6709;&#x82E5;&#x5E72;&#x534E;&#x4E3A;HDE&#xFF0C;&#x4EE5;&#x53CA;&#x82E5;&#x5E72;&#x5176;&#x4ED6;&#x9886;&#x57DF;&#x7684;&#x4E09;&#x5341;&#x4F59;&#x4F4D;&#x4E07;&#x7C89;&#x535A;&#x4E3B;&#x8FD0;&#x8425;&#x3002;&#x4E13;&#x6CE8;&#x4E8E;&#x5206;&#x4EAB;&#x7684;&#x6280;&#x672F;&#x5305;&#x62EC;HarmonyOS/OpenHarmony&#xFF0C;ArkUI-X&#xFF0C;&#x5143;&#x670D;&#x52A1;&#xFF0C;&#x670D;&#x52A1;&#x5361;&#x7247;&#xFF0C;&#x534E;&#x4E3A;&#x81EA;&#x7814;&#x8BED;&#x8A00;&#xFF0C;BlueOS&#x64CD;&#x4F5C;&#x7CFB;&#x7EDF;&#x3001;&#x56E2;&#x961F;&#x6210;&#x5458;&#x805A;&#x96C6;&#x5728;&#x5317;&#x4EAC;&#x3001;&#x4E0A;&#x6D77;&#x3001;&#x5E7F;&#x5DDE;&#x3001;&#x6DF1;&#x5733;&#x3001;&#x5357;&#x4EAC;&#x3001;&#x676D;&#x5DDE;&#x3001;&#x82CF;&#x5DDE;&#x3001;&#x5B81;&#x590F;&#x7B49;&#x5730;&#x3002; &#x805A;&#x7126;&#x201C;&#x9E3F;&#x8499;&#x539F;&#x751F;&#x5E94;&#x7528;&#x201D;&#x3001;&#x201C;&#x667A;&#x80FD;&#x7269;&#x8054;&#x201D;&#x548C;&#x201C;AI&#x8D4B;&#x80FD;&#x201D;&#x3001;&#x201C;&#x4EBA;&#x5DE5;&#x667A;&#x80FD;&#x201D;&#x56DB;&#x5927;&#x4E1A;&#x52A1;&#x9886;&#x57DF;&#xFF0C;&#x4F9D;&#x6258;&#x534E;&#x4E3A;&#x5F00;&#x53D1;&#x8005;&#x4E13;&#x5BB6;&#x7B49;&#x5F3A;&#x5927;&#x7684;&#x6280;&#x672F;&#x56E2;&#x961F;&#xFF0C;&#x4EE5;&#x53CA;&#x6DB5;&#x76D6;&#x9700;&#x6C42;&#x3001;&#x5F00;&#x53D1;&#x3001;&#x6D4B;&#x8BD5;&#x3001;&#x8FD0;&#x7EF4;&#x4E8E;&#x4E00;&#x4F53;&#x7684;&#x7EFC;&#x5408;&#x670D;&#x52A1;&#x4F53;&#x7CFB;&#xFF0C;&#x8D4B;&#x80FD;&#x6587;&#x65C5;&#x3001;&#x5A92;&#x4F53;&#x3001;&#x793E;&#x4EA4;&#x3001;&#x5BB6;&#x5C45;&#x3001;&#x6D88;&#x8D39;&#x7535;&#x5B50;&#x7B49;&#x884C;&#x4E1A;&#x5BA2;&#x6237;&#xFF0C;&#x6EE1;&#x8DB3;&#x793E;&#x533A;&#x5BA2;&#x6237;&#x6570;&#x5B57;&#x5316;&#x5347;&#x7EA7;&#x8F6C;&#x578B;&#x7684;&#x9700;&#x6C42;&#xFF0C;&#x5E2E;&#x52A9;&#x5BA2;&#x6237;&#x5B9E;&#x73B0;&#x4EF7;&#x503C;&#x63D0;&#x5347;&#x3002; &#x76EE;&#x524D;&#x4E0A;&#x67B6;&#x9E3F;&#x8499;&#x539F;&#x751F;&#x5E94;&#x7528;18&#x6B3E;&#xFF0C;&#x4E09;&#x65B9;&#x5E93;72&#x4E2A;&#x3002;</p>
<p>&#x5730;&#x5740;&#xFF1A;</p>
<ul>
<li><a href="https://atomgit.com/nutpi" target="_blank">https://atomgit.com/nutpi</a></li>
<li><a href="https://gitcode.com/nutpi" target="_blank">https://gitcode.com/nutpi</a></li>
<li><a href="https://www.nutpi.net/" target="_blank">https://www.nutpi.net/</a></li>
</ul>
<h2 id="&#x516B;&#x3001;&#x9E3F;&#x8499;-flutter-&#x63D2;&#x4EF6;&#xFF1A;&#x83B7;&#x53D6;-oaid-&#x4E0E;&#x5E94;&#x7528;&#x8DDF;&#x8E2A;&#x6743;&#x9650;&#x5904;&#x7406;">&#x516B;&#x3001;&#x9E3F;&#x8499; Flutter &#x63D2;&#x4EF6;&#xFF1A;&#x83B7;&#x53D6; OAID &#x4E0E;&#x5E94;&#x7528;&#x8DDF;&#x8E2A;&#x6743;&#x9650;&#x5904;&#x7406;</h2>
<p>&#x672C;&#x6587;&#x6863;&#x65E8;&#x5728;&#x8BE6;&#x7EC6;&#x8BF4;&#x660E;&#x5728;&#x4E00;&#x4E2A; Flutter &#x63D2;&#x4EF6;&#x4E2D;&#xFF0C;&#x9E3F;&#x8499;&#xFF08;HarmonyOS&#xFF09;&#x539F;&#x751F;&#x4FA7;&#x5982;&#x4F55;&#x5904;&#x7406;&#x83B7;&#x53D6; OAID&#xFF08;&#x5F00;&#x653E;&#x533F;&#x540D;&#x8BBE;&#x5907;&#x6807;&#x8BC6;&#x7B26;&#xFF09;&#x65F6;&#x6240;&#x9700;&#x7684;&#x5E94;&#x7528;&#x8DDF;&#x8E2A;&#x6743;&#x9650;&#xFF08;<code>ohos.permission.APP_TRACKING_CONSENT</code>&#xFF09;&#x3002;&#x6211;&#x4EEC;&#x5C06;&#x57FA;&#x4E8E; <code>FlutterUdidPlugin.ets</code> &#x548C; <code>RequestPermissions.ets</code> &#x8FD9;&#x4E24;&#x4E2A;&#x5173;&#x952E;&#x6587;&#x4EF6;&#x8FDB;&#x884C;&#x5206;&#x6790;&#x3002;</p>
<p>&#x5728;&#x8BB8;&#x591A;&#x573A;&#x666F;&#x4E0B;&#xFF0C;&#x5E94;&#x7528;&#x9700;&#x8981;&#x4E00;&#x4E2A;&#x8BBE;&#x5907;&#x6807;&#x8BC6;&#x7B26;&#x6765;&#x8FDB;&#x884C;&#x6570;&#x636E;&#x5206;&#x6790;&#x3001;&#x5E7F;&#x544A;&#x6295;&#x653E;&#x7B49;&#x3002;&#x5728;&#x9E3F;&#x8499;&#x7CFB;&#x7EDF;&#x4E2D;&#xFF0C;OAID &#x662F;&#x63A8;&#x8350;&#x4F7F;&#x7528;&#x7684;&#x975E;&#x6C38;&#x4E45;&#x6027;&#x3001;&#x53EF;&#x91CD;&#x7F6E;&#x7684;&#x8BBE;&#x5907;&#x6807;&#x8BC6;&#x7B26;&#x3002;&#x7136;&#x800C;&#xFF0C;&#x83B7;&#x53D6; OAID &#x9700;&#x8981;&#x7528;&#x6237;&#x660E;&#x786E;&#x6388;&#x4E88;&#x201C;&#x5E94;&#x7528;&#x8DDF;&#x8E2A;&#x201D;&#x6743;&#x9650;&#x3002;</p>
<p>&#x6211;&#x4EEC;&#x7684; Flutter &#x63D2;&#x4EF6; <code>flutter_udid</code> &#x65E8;&#x5728;&#x63D0;&#x4F9B;&#x4E00;&#x4E2A;&#x8DE8;&#x5E73;&#x53F0;&#x7684;&#x63A5;&#x53E3;&#x6765;&#x83B7;&#x53D6;&#x8BBE;&#x5907;&#x6807;&#x8BC6;&#x7B26;&#x3002;&#x5728;&#x9E3F;&#x8499;&#x4FA7;&#xFF0C;&#x8FD9;&#x610F;&#x5473;&#x7740;&#x6211;&#x4EEC;&#x9700;&#x8981;&#xFF1A;</p>
<ol>
<li>&#x68C0;&#x67E5;&#x5E94;&#x7528;&#x662F;&#x5426;&#x5DF2;&#x88AB;&#x6388;&#x4E88; <code>ohos.permission.APP_TRACKING_CONSENT</code> &#x6743;&#x9650;&#x3002;</li>
<li>&#x5982;&#x679C;&#x672A;&#x6388;&#x6743;&#xFF0C;&#x5411;&#x7528;&#x6237;&#x8BF7;&#x6C42;&#x8BE5;&#x6743;&#x9650;&#x3002;</li>
<li>&#x5728;&#x83B7;&#x5F97;&#x6743;&#x9650;&#x540E;&#xFF0C;&#x8C03;&#x7528;&#x9E3F;&#x8499;&#x63D0;&#x4F9B;&#x7684; API &#x83B7;&#x53D6; OAID&#x3002;</li>
</ol>
<h3 id="&#x6743;&#x9650;&#x5904;&#x7406;&#x6838;&#x5FC3;&#xFF1A;requestpermissionsets">&#x6743;&#x9650;&#x5904;&#x7406;&#x6838;&#x5FC3;&#xFF1A;<code>RequestPermissions.ets</code></h3>
<p><code>RequestPermissions.ets</code> &#x6587;&#x4EF6;&#x5C01;&#x88C5;&#x4E86;&#x68C0;&#x67E5;&#x548C;&#x8BF7;&#x6C42; <code>ohos.permission.APP_TRACKING_CONSENT</code> &#x6743;&#x9650;&#x7684;&#x903B;&#x8F91;&#x3002;&#x5176;&#x6838;&#x5FC3;&#x529F;&#x80FD;&#x5206;&#x4E3A;&#x4E24;&#x90E8;&#x5206;&#xFF1A;&#x68C0;&#x67E5;&#x6743;&#x9650;&#x548C;&#x8BF7;&#x6C42;&#x6743;&#x9650;&#x3002;</p>
<h3 id="1-&#x68C0;&#x67E5;&#x6743;&#x9650;-checkpermissions-&#x548C;-checkaccesstoken">1. &#x68C0;&#x67E5;&#x6743;&#x9650; (<code>checkPermissions</code> &#x548C; <code>checkAccessToken</code>)</h3>
<ul>
<li><code>checkPermissions(permissions: Array&lt;Permissions&gt;): Promise&lt;boolean&gt;</code>: &#x8FD9;&#x662F;&#x66B4;&#x9732;&#x7ED9;&#x5916;&#x90E8;&#x8C03;&#x7528;&#x7684;&#x51FD;&#x6570;&#xFF0C;&#x7528;&#x4E8E;&#x68C0;&#x67E5;&#x4F20;&#x5165;&#x7684;&#x6743;&#x9650;&#x5217;&#x8868;&#xFF08;&#x5728;&#x6B64;&#x573A;&#x666F;&#x4E0B;&#x4E3B;&#x8981;&#x662F; <code>appTrackingConsentPermission</code>&#xFF09;&#x662F;&#x5426;&#x5DF2;&#x88AB;&#x6388;&#x4E88;&#x3002;</li>
<li><code>checkAccessToken(permission: Permissions): Promise&lt;abilityAccessCtrl.GrantStatus&gt;</code>: &#x8FD9;&#x662F;&#x5B9E;&#x9645;&#x6267;&#x884C;&#x6743;&#x9650;&#x68C0;&#x67E5;&#x7684;&#x5185;&#x90E8;&#x51FD;&#x6570;&#x3002;&#x5B83;&#x6267;&#x884C;&#x4EE5;&#x4E0B;&#x6B65;&#x9AA4;&#xFF1A;<ol>
<li>&#x4F7F;&#x7528; <code>abilityAccessCtrl.createAtManager()</code> &#x521B;&#x5EFA;&#x6743;&#x9650;&#x7BA1;&#x7406;&#x5B9E;&#x4F8B;&#x3002;</li>
<li>&#x4F7F;&#x7528; <code>bundleManager.getBundleInfoForSelf()</code> &#x83B7;&#x53D6;&#x5F53;&#x524D;&#x5E94;&#x7528;&#x7684; <code>tokenId</code> (accessTokenId)&#x3002;&#x8FD9;&#x662F;&#x68C0;&#x67E5;&#x7279;&#x5B9A;&#x5E94;&#x7528;&#x6743;&#x9650;&#x6240;&#x5FC5;&#x9700;&#x7684;&#x3002;</li>
<li>&#x8C03;&#x7528; <code>atManager.checkAccessToken(tokenId, permission)</code> &#x6765;&#x68C0;&#x67E5;&#x6307;&#x5B9A; <code>tokenId</code> &#x7684;&#x5E94;&#x7528;&#x662F;&#x5426;&#x5DF2;&#x88AB;&#x6388;&#x4E88; <code>permission</code>&#x3002;</li>
<li>&#x8FD4;&#x56DE;&#x6743;&#x9650;&#x7684;&#x6388;&#x4E88;&#x72B6;&#x6001; (<code>GrantStatus</code>)&#x3002;</li>
</ol>
</li>
<li><code>checkPermissions</code> &#x51FD;&#x6570;&#x6700;&#x7EC8;&#x4F1A;&#x6BD4;&#x8F83; <code>checkAccessToken</code> &#x8FD4;&#x56DE;&#x7684;&#x72B6;&#x6001;&#x662F;&#x5426;&#x4E3A; <code>PERMISSION_GRANTED</code>&#xFF0C;&#x5E76;&#x8FD4;&#x56DE;&#x4E00;&#x4E2A;&#x5E03;&#x5C14;&#x503C;&#x3002;</li>
</ul>
<pre><code class="lang-typescript"><span class="hljs-comment">// RequestPermissions.ets (&#x7B80;&#x5316;&#x793A;&#x4F8B;)</span>
<span class="hljs-keyword">import</span> bundleManager from <span class="hljs-string">&apos;@ohos.bundle.bundleManager&apos;</span>;
<span class="hljs-keyword">import</span> abilityAccessCtrl, { Permissions } from <span class="hljs-string">&apos;@ohos.abilityAccessCtrl&apos;</span>;

<span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> appTrackingConsentPermission: <span class="hljs-built_in">Array</span>&lt;Permissions&gt; = [<span class="hljs-string">&apos;ohos.permission.APP_TRACKING_CONSENT&apos;</span>];

async <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">checkAccessToken</span>(<span class="hljs-params">permission: Permissions</span>): <span class="hljs-title">Promise</span>&lt;<span class="hljs-title">abilityAccessCtrl</span>.<span class="hljs-title">GrantStatus</span>&gt; </span>{
  <span class="hljs-comment">// ... &#x83B7;&#x53D6; tokenId</span>
  <span class="hljs-comment">// ... &#x8C03;&#x7528; atManager.checkAccessToken(tokenId, permission)</span>
  <span class="hljs-comment">// ... &#x8FD4;&#x56DE; grantStatus</span>
}

<span class="hljs-keyword">export</span> async <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">checkPermissions</span>(<span class="hljs-params">permissions: <span class="hljs-built_in">Array</span>&lt;Permissions&gt;</span>): <span class="hljs-title">Promise</span>&lt;<span class="hljs-title">boolean</span>&gt; </span>{
  <span class="hljs-keyword">let</span> grantStatus: abilityAccessCtrl.GrantStatus = await checkAccessToken(permissions[<span class="hljs-number">0</span>]);
  <span class="hljs-keyword">return</span> grantStatus === abilityAccessCtrl.GrantStatus.PERMISSION_GRANTED;
}
</code></pre>
<h3 id="2-&#x8BF7;&#x6C42;&#x6743;&#x9650;-requestpermissions">2. &#x8BF7;&#x6C42;&#x6743;&#x9650; (<code>requestPermissions</code>)</h3>
<ul>
<li><code>requestPermissions(context: Context): Promise&lt;boolean&gt;</code>: &#x8FD9;&#x662F;&#x4E3B;&#x8981;&#x7684;&#x6743;&#x9650;&#x8BF7;&#x6C42;&#x51FD;&#x6570;&#x3002;<ol>
<li>&#x9996;&#x5148;&#x8C03;&#x7528; <code>checkPermissions</code> &#x68C0;&#x67E5;&#x662F;&#x5426;&#x5DF2;&#x83B7;&#x5F97; <code>appTrackingConsentPermission</code>&#x3002;</li>
<li><strong>&#x5982;&#x679C;&#x5DF2;&#x6388;&#x6743;</strong>&#xFF1A;&#x76F4;&#x63A5;&#x8FD4;&#x56DE; <code>true</code>&#x3002;</li>
<li><strong>&#x5982;&#x679C;&#x672A;&#x6388;&#x6743;</strong>&#xFF1A;<ul>
<li>&#x521B;&#x5EFA; <code>abilityAccessCtrl.AtManager</code> &#x5B9E;&#x4F8B;&#x3002;</li>
<li>&#x8C03;&#x7528; <code>atManager.requestPermissionsFromUser(context, appTrackingConsentPermission)</code>&#x3002;&#x8FD9;&#x4E2A;&#x65B9;&#x6CD5;&#x4F1A;&#x89E6;&#x53D1;&#x7CFB;&#x7EDF;&#x5F39;&#x7A97;&#xFF0C;&#x8BF7;&#x6C42;&#x7528;&#x6237;&#x6388;&#x6743;&#x3002;</li>
<li><code>requestPermissionsFromUser</code> &#x8FD4;&#x56DE;&#x4E00;&#x4E2A;&#x5305;&#x542B;&#x6388;&#x6743;&#x7ED3;&#x679C;&#xFF08;<code>authResults</code>&#xFF09;&#x7684;&#x5BF9;&#x8C61;&#x3002;&#x8FD9;&#x662F;&#x4E00;&#x4E2A;&#x6570;&#x5B57;&#x6570;&#x7EC4;&#xFF0C;<code>0</code> &#x4EE3;&#x8868;&#x6388;&#x4E88;&#xFF0C;&#x975E; <code>0</code> &#x4EE3;&#x8868;&#x62D2;&#x7EDD;&#x3002;</li>
<li>&#x904D;&#x5386; <code>authResults</code>&#xFF0C;&#x5982;&#x679C;&#x6240;&#x6709;&#x8BF7;&#x6C42;&#x7684;&#x6743;&#x9650;&#x90FD;&#x88AB;&#x6388;&#x4E88;&#xFF08;&#x5373;&#x6240;&#x6709;&#x7ED3;&#x679C;&#x90FD;&#x662F; <code>0</code>&#xFF09;&#xFF0C;&#x5219;&#x8FD4;&#x56DE; <code>true</code>&#xFF1B;&#x5426;&#x5219;&#x8FD4;&#x56DE; <code>false</code>&#x3002;</li>
<li>&#x5305;&#x542B;&#x9519;&#x8BEF;&#x5904;&#x7406;&#x903B;&#x8F91;&#xFF0C;&#x6355;&#x83B7;&#x8BF7;&#x6C42;&#x8FC7;&#x7A0B;&#x4E2D;&#x53EF;&#x80FD;&#x51FA;&#x73B0;&#x7684; <code>BusinessError</code>&#x3002;</li>
</ul>
</li>
</ol>
</li>
</ul>
<pre><code class="lang-typescript"><span class="hljs-comment">// RequestPermissions.ets (&#x7B80;&#x5316;&#x793A;&#x4F8B;)</span>
<span class="hljs-keyword">export</span> async <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">requestPermissions</span>(<span class="hljs-params">
  context: Context
</span>): <span class="hljs-title">Promise</span>&lt;<span class="hljs-title">boolean</span>&gt; </span>{
  <span class="hljs-keyword">const</span> hasPermission: <span class="hljs-built_in">boolean</span> = await checkPermissions(appTrackingConsentPermission);

  <span class="hljs-keyword">if</span> (!hasPermission) {
    <span class="hljs-keyword">let</span> atManager = abilityAccessCtrl.createAtManager();
    <span class="hljs-keyword">try</span> {
      <span class="hljs-keyword">let</span> data = await atManager.requestPermissionsFromUser(context, appTrackingConsentPermission);
      <span class="hljs-comment">// ... &#x68C0;&#x67E5; data.authResults ...</span>
      <span class="hljs-comment">// ... &#x8FD4;&#x56DE; true &#x6216; false</span>
    } <span class="hljs-keyword">catch</span> (error) {
      <span class="hljs-comment">// ... &#x5904;&#x7406;&#x9519;&#x8BEF;&#xFF0C;&#x8FD4;&#x56DE; false</span>
    }
  } <span class="hljs-keyword">else</span> {
    <span class="hljs-keyword">return</span> <span class="hljs-literal">true</span>;
  }
}
</code></pre>
<h3 id="&#x63D2;&#x4EF6;&#x96C6;&#x6210;&#xFF1A;flutterudidpluginets">&#x63D2;&#x4EF6;&#x96C6;&#x6210;&#xFF1A;<code>FlutterUdidPlugin.ets</code></h3>
<p><code>FlutterUdidPlugin.ets</code> &#x662F; Flutter &#x4E0E;&#x9E3F;&#x8499;&#x539F;&#x751F;&#x4EE3;&#x7801;&#x4EA4;&#x4E92;&#x7684;&#x6865;&#x6881;&#x3002;&#x5B83;&#x901A;&#x8FC7; <code>MethodChannel</code> &#x63A5;&#x6536;&#x6765;&#x81EA; Flutter &#x7AEF;&#x7684;&#x8C03;&#x7528;&#x3002;</p>
<p>&#x5F53; Flutter &#x7AEF;&#x8C03;&#x7528; <code>getUDID</code> &#x65B9;&#x6CD5;&#x65F6;&#xFF0C;<code>onMethodCall</code> &#x51FD;&#x6570;&#x4F1A;&#x88AB;&#x89E6;&#x53D1;&#xFF1A;</p>
<ol>
<li><strong>&#x8C03;&#x7528;&#x6743;&#x9650;&#x8BF7;&#x6C42;</strong>: &#x9996;&#x5148;&#x8C03;&#x7528; <code>this.requestPermissions()</code>&#x3002;&#x6CE8;&#x610F;&#xFF0C;&#x8FD9;&#x4E2A; <code>requestPermissions</code> &#x662F; <code>FlutterUdidPlugin</code> &#x7C7B;&#x5185;&#x90E8;&#x7684;&#x65B9;&#x6CD5;&#xFF0C;&#x5B83;&#x4F1A;&#x8FDB;&#x4E00;&#x6B65;&#x8C03;&#x7528;&#x6211;&#x4EEC;&#x4E4B;&#x524D;&#x5206;&#x6790;&#x7684; <code>RequestPermissions.ets</code> &#x4E2D;&#x7684; <code>requestPermissions</code> &#x51FD;&#x6570;&#x3002;<ul>
<li><code>FlutterUdidPlugin</code> &#x5185;&#x90E8;&#x7684; <code>requestPermissions</code> &#x65B9;&#x6CD5;&#x9700;&#x8981;&#x786E;&#x4FDD; <code>this.ability</code> (&#x5F53;&#x524D;&#x7684; UIAbility &#x5B9E;&#x4F8B;) &#x4E0D;&#x4E3A; <code>null</code>&#xFF0C;&#x56E0;&#x4E3A;&#x8BF7;&#x6C42;&#x6743;&#x9650;&#x9700;&#x8981;&#x4E00;&#x4E2A; <code>Context</code>&#xFF0C;&#x901A;&#x5E38;&#x4ECE; <code>Ability</code> &#x83B7;&#x53D6;&#x3002;</li>
<li>&#x5B83;&#x8C03;&#x7528; <code>RequestPermissions.ets</code> &#x4E2D;&#x7684; <code>requestPermissions(this.ability!.context)</code>&#x3002;</li>
</ul>
</li>
<li><strong>&#x5904;&#x7406;&#x6743;&#x9650;&#x7ED3;&#x679C;</strong>: <code>this.requestPermissions()</code> &#x8FD4;&#x56DE;&#x4E00;&#x4E2A; Promise&#xFF0C;&#x5176;&#x7ED3;&#x679C;&#x662F;&#x4E00;&#x4E2A;&#x5E03;&#x5C14;&#x503C; <code>data</code>&#xFF0C;&#x8868;&#x793A;&#x6743;&#x9650;&#x662F;&#x5426;&#x88AB;&#x6388;&#x4E88;&#x3002;</li>
<li><strong>&#x83B7;&#x53D6; OAID</strong>: &#x5728;&#x6743;&#x9650;&#x8BF7;&#x6C42;&#x7684; Promise &#x5B8C;&#x6210;&#x540E;&#xFF08;<code>.then((data: boolean) =&gt; { ... })</code>&#xFF09;&#xFF0C;&#x65E0;&#x8BBA;&#x6743;&#x9650;&#x662F;&#x5426;&#x6210;&#x529F;&#x6388;&#x4E88;&#xFF08;&#x867D;&#x7136;&#x903B;&#x8F91;&#x4E0A;&#x5E94;&#x8BE5;&#x53EA;&#x5728;&#x6388;&#x4E88;&#x540E;&#x83B7;&#x53D6;&#xFF0C;&#x4F46;&#x5F53;&#x524D;&#x4EE3;&#x7801;&#x7ED3;&#x6784;&#x662F;&#x5728; then &#x56DE;&#x8C03;&#x4E2D;&#x76F4;&#x63A5;&#x8C03;&#x7528; <code>getUDID</code>&#xFF09;&#xFF0C;&#x90FD;&#x4F1A;&#x8C03;&#x7528; <code>this.getUDID()</code>&#x3002;<ul>
<li><code>getUDID()</code> &#x65B9;&#x6CD5;&#x4F7F;&#x7528; <code>@kit.AdsKit</code> &#x4E2D;&#x7684; <code>identifier.getOAID()</code> &#x6765;&#x5F02;&#x6B65;&#x83B7;&#x53D6; OAID&#x3002;</li>
</ul>
</li>
<li><strong>&#x8FD4;&#x56DE;&#x7ED3;&#x679C;&#x7ED9; Flutter</strong>: &#x83B7;&#x53D6; OAID &#x7684; Promise &#x5B8C;&#x6210;&#x540E; (<code>.then((udid: string | null) =&gt; { ... })</code>)&#xFF1A;<ul>
<li>&#x5982;&#x679C; <code>udid</code> &#x4E3A; <code>null</code> &#x6216;&#x7A7A;&#x5B57;&#x7B26;&#x4E32;&#xFF0C;&#x901A;&#x8FC7; <code>result.error()</code> &#x8FD4;&#x56DE;&#x9519;&#x8BEF;&#x7ED9; Flutter &#x7AEF;&#x3002;</li>
<li>&#x5982;&#x679C;&#x6210;&#x529F;&#x83B7;&#x53D6; <code>udid</code>&#xFF0C;&#x901A;&#x8FC7; <code>result.success(udid)</code> &#x5C06; OAID &#x8FD4;&#x56DE;&#x7ED9; Flutter &#x7AEF;&#x3002;</li>
</ul>
</li>
</ol>
<pre><code class="lang-typescript"><span class="hljs-comment">// FlutterUdidPlugin.ets (&#x7B80;&#x5316;&#x793A;&#x4F8B;)</span>
<span class="hljs-keyword">import</span> { requestPermissions as requestAppPermissions } from <span class="hljs-string">&apos;./RequestPermissions&apos;</span>;
<span class="hljs-keyword">import</span> { identifier } from <span class="hljs-string">&apos;@kit.AdsKit&apos;</span>;

<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> <span class="hljs-keyword">class</span> FlutterUdidPlugin <span class="hljs-keyword">implements</span> MethodCallHandler, FlutterPlugin {
  <span class="hljs-comment">// ... &#x5176;&#x4ED6;&#x6210;&#x5458;&#x548C;&#x65B9;&#x6CD5; ...</span>
  <span class="hljs-keyword">private</span> ability: UIAbility | <span class="hljs-literal">null</span> = <span class="hljs-literal">null</span>;

  onMethodCall(call: MethodCall, result: MethodResult): <span class="hljs-built_in">void</span> {
    <span class="hljs-keyword">if</span> (call.method == <span class="hljs-string">&quot;getUDID&quot;</span>) {
      <span class="hljs-keyword">this</span>.requestPermissions().then((granted: <span class="hljs-built_in">boolean</span>) =&gt; {
        <span class="hljs-comment">// &#x6CE8;&#x610F;&#xFF1A;&#x539F;&#x59CB;&#x4EE3;&#x7801;&#x5728;&#x8FD9;&#x91CC;&#x6CA1;&#x6709;&#x663E;&#x5F0F;&#x68C0;&#x67E5; granted &#x7684;&#x503C;</span>
        <span class="hljs-comment">// &#x7406;&#x60F3;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;&#x5E94;&#x8BE5;&#x68C0;&#x67E5; granted &#x662F;&#x5426;&#x4E3A; true</span>
        <span class="hljs-comment">// if (granted) { ... } else { result.error(...) }</span>
        <span class="hljs-keyword">this</span>.getUDID().then((udid: <span class="hljs-built_in">string</span> | <span class="hljs-literal">null</span>) =&gt; {
          <span class="hljs-keyword">if</span> (udid) {
            result.success(udid);
          } <span class="hljs-keyword">else</span> {
            result.error(<span class="hljs-string">&quot;UNAVAILABLE&quot;</span>, <span class="hljs-string">&quot;UDID not available.&quot;</span>, <span class="hljs-literal">null</span>);
          }
        });
      });
    } <span class="hljs-keyword">else</span> {
      result.notImplemented();
    }
  }

  <span class="hljs-keyword">private</span> async getUDID(): Promise&lt;<span class="hljs-built_in">string</span> | <span class="hljs-literal">null</span>&gt; {
    <span class="hljs-keyword">try</span> {
      <span class="hljs-keyword">return</span> await identifier.getOAID();
    } <span class="hljs-keyword">catch</span> (err) {
      <span class="hljs-keyword">return</span> <span class="hljs-literal">null</span>;
    }
  }

  <span class="hljs-keyword">private</span> async requestPermissions(): Promise&lt;<span class="hljs-built_in">boolean</span>&gt; {
    <span class="hljs-keyword">if</span> (!<span class="hljs-keyword">this</span>.ability) {
      <span class="hljs-keyword">return</span> <span class="hljs-literal">false</span>;
    }
    <span class="hljs-keyword">try</span> {
      <span class="hljs-comment">// &#x8C03;&#x7528; RequestPermissions.ets &#x4E2D;&#x7684;&#x51FD;&#x6570;</span>
      <span class="hljs-keyword">return</span> await requestAppPermissions(<span class="hljs-keyword">this</span>.ability!.context);
    } <span class="hljs-keyword">catch</span> (e) {
      <span class="hljs-keyword">return</span> <span class="hljs-literal">false</span>;
    }
  }
}
</code></pre>
<h3 id="&#x7ED3;&#x8BBA;">&#x7ED3;&#x8BBA;</h3>
<p>&#x901A;&#x8FC7; <code>RequestPermissions.ets</code> &#x5C01;&#x88C5;&#x9E3F;&#x8499;&#x7684;&#x6743;&#x9650;&#x68C0;&#x67E5;&#x548C;&#x8BF7;&#x6C42;&#x903B;&#x8F91;&#xFF0C;<code>FlutterUdidPlugin.ets</code> &#x53EF;&#x4EE5;&#x5728;&#x9700;&#x8981;&#x65F6;&#x8C03;&#x7528;&#x8FD9;&#x4E9B;&#x529F;&#x80FD;&#xFF0C;&#x786E;&#x4FDD;&#x5728;&#x83B7;&#x53D6; OAID &#x4E4B;&#x524D;&#xFF0C;&#x5E94;&#x7528;&#x5DF2;&#x7ECF;&#x83B7;&#x5F97;&#x4E86;&#x7528;&#x6237;&#x7684;&#x5E94;&#x7528;&#x8DDF;&#x8E2A;&#x8BB8;&#x53EF;&#x3002;&#x8FD9;&#x79CD;&#x5206;&#x5C42;&#x8BBE;&#x8BA1;&#x4F7F;&#x5F97;&#x6743;&#x9650;&#x7BA1;&#x7406;&#x903B;&#x8F91;&#x6E05;&#x6670;&#x3001;&#x53EF;&#x590D;&#x7528;&#xFF0C;&#x5E76;&#x7B80;&#x5316;&#x4E86;&#x4E3B;&#x63D2;&#x4EF6;&#x903B;&#x8F91;&#x3002;</p>
<p><strong>&#x6CE8;&#x610F;</strong>: &#x793A;&#x4F8B;&#x4EE3;&#x7801;&#x4E2D;&#x7684; <code>onMethodCall</code> &#x5728;&#x8C03;&#x7528; <code>getUDID</code> &#x524D;&#x5E76;&#x672A;&#x4E25;&#x683C;&#x68C0;&#x67E5; <code>requestPermissions</code> &#x7684;&#x8FD4;&#x56DE;&#x7ED3;&#x679C;&#x3002;&#x5728;&#x5B9E;&#x9645;&#x5E94;&#x7528;&#x4E2D;&#xFF0C;&#x5EFA;&#x8BAE;&#x5728;&#x786E;&#x8BA4;&#x6743;&#x9650;&#x88AB;&#x6388;&#x4E88; (<code>granted === true</code>) &#x540E;&#x624D;&#x6267;&#x884C;&#x83B7;&#x53D6; OAID &#x7684;&#x64CD;&#x4F5C;&#xFF0C;&#x5E76;&#x5728;&#x6743;&#x9650;&#x88AB;&#x62D2;&#x7EDD;&#x65F6;&#x5411; Flutter &#x8FD4;&#x56DE;&#x76F8;&#x5E94;&#x7684;&#x9519;&#x8BEF;&#x4FE1;&#x606F;&#x3002;</p>
<h2 id="&#x547D;&#x4EE4;">&#x547D;&#x4EE4;</h2>
<pre><code>flutter pub get

 flutter build hap --debug



flutter config --ohos-sdk=/Users/jianguo/Library/OpenHarmony/Sdk

flutter config --ohos-sdk=&quot;&quot;
</code></pre><footer class="page-footer"><span class="copyright">powered by Gitbook</span><span class="footer-modification">&#x8BE5;&#x6587;&#x4EF6;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2025-09-04 08:17:16
</span></footer>
<script>console.log("plugin-popup....");document.onclick = function(e){ e.target.tagName === "IMG" && window.open(e.target.src,e.target.src)}</script><style>img{cursor:pointer}</style> 
          </section>
          
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>
 
          <div class="book-footer">
            
            <div class="donate">
              <div></div>
              <button class="donate-btn" onclick="showModal()">赞赏</button>
            </div>
             
            <div class="copyright"></div>
            
          </div>
          
        </div>
      </div>
      
    </div>

     
    <a
      href="12.3适配三方库之FlutterToast.html"
      class="navigation navigation-prev "
      aria-label="Previous page: 13.3适配三方库之FlutterToast"
    >
      <i class="fa fa-angle-left"></i>
    </a>
     
    <a
      href="12.5适配torch_light.html"
      class="navigation navigation-next "
      aria-label="Next page: 13.5适配torch_light"
    >
      <i class="fa fa-angle-right"></i>
    </a>
      
  </div>
  <script>
    function showModal() {
      document.getElementsByClassName("mask")[0].style.display = "block";
      document.getElementsByClassName("donate-modal")[0].style.display =
        "block";
    }
    // 切换赞赏码
    function showDonateImg(num) {
      let alipay = "";
      let wxpay = ""
      if(num){
        wxpay = "hidden"
      }else{
        alipay = "hidden"
      }
      document.getElementById("wxpay-code").hidden = wxpay;
      document.getElementById("alipay-code").hidden = alipay;
      document.getElementsByName("pay-way")[num].checked = "checked";
    }

    // 关闭赞赏框
    function closeDonateModal() {
      document.getElementsByClassName("mask")[0].style.display = "none";
      document.getElementsByClassName("donate-modal")[0].style.display = "none";
    }

    var gitbook = gitbook || [];
    gitbook.push(function () {
      gitbook.page.hasChanged({"page":{"title":"13.4适配三方库之udid","level":"1.13.4","depth":2,"next":{"title":"13.5适配torch_light","level":"1.13.5","depth":2,"path":"chapter12/12.5适配torch_light.md","ref":"./chapter12/12.5适配torch_light.md","articles":[]},"previous":{"title":"13.3适配三方库之FlutterToast","level":"1.13.3","depth":2,"path":"chapter12/12.3适配三方库之FlutterToast.md","ref":"./chapter12/12.3适配三方库之FlutterToast.md","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","splitter","tbfed-pagefooter","expandable-chapters","chapter-fold","back-to-top-button","code","pageview-count","popup","search-plus","-lunr","-search","-sharing","sharing-plus","theme-lou","emphasize","livereload","gitcode-issue-feedback","forkmegithub","livereload"],"root":".","styles":{"website":"styles/website.css"},"pluginsConfig":{"tbfed-pagefooter":{"modify_label":"该文件修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"chapter-fold":{},"pluginsConfig":{"expandable-chapters":{}},"emphasize":{},"livereload":{},"gitcode-issue-feedback":{"repo":"nutpi/gitbook-harmonyos-flutter"},"splitter":{},"readmore":{"blogId":"27976-1678928361372-483","name":"坚果派","qrcode":"https://luckly007.oss-cn-beijing.aliyuncs.com/images/image-20230316085818226.png","keyword":"鸿蒙坚果"},"sharing-plus":{"qq":false,"all":["facebook","google","twitter","instapaper","linkedin","pocket","stumbleupon"],"douban":false,"facebook":true,"weibo":false,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":true,"messenger":false,"line":false,"vk":false,"pocket":true,"google":false,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":false},"popup":{},"code":{"copyButtons":true},"theme-lou":{"hide-elements":[".summary .gitbook-link",".summary .divider"],"color":"#FF4848","book-anchor-title":"本章目录","copyright":{"author":"vx:nut_pie"},"forbidCopy":true,"logo":"assets/avatar.png","book-summary-title":"文章目录","search-placeholder":"输入关键字搜索","copyrightLogo":"assets/copyright.png","favicon":"assets/avatar.png","appleTouchIconPrecomposed152":"assets/avatar.png"},"changyan":{"appid":"cyvHoCPAs","conf":"0440cfc4168ba95d73cfc52dd4d5c60b"},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"back-to-top-button":{},"pageview-count":{},"sharing":{"qq":false,"all":["qq","qzone","whatsapp","douban","facebook","google","instapaper","linkedin","messenger","twitter","weibo"],"douban":false,"facebook":false,"weibo":false,"twitter":false,"pocket":false,"google":false,"qzone":false},"edit-link":{"label":"编辑此页","base":"https://gitcode.com/nutpi/gitbook-harmonyos-flutter/edit/master/"},"forkmegithub":{"color":"gray","url":"https://gitcode.com/nutpi/gitbook-harmonyos-flutter/fork/create"},"theme-default":{"styles":{"pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css","website":"styles/website.css"},"showLevel":false},"expandable-chapters":{},"search-plus":{}},"theme":"default","author":"坚果派","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{"themeLou":{"nav":[{"target":"_blank","url":"https://www.nutpi.net/","name":"坚果派官网"},{"target":"_blank","url":"https://www.arkui.club/","name":"ArkUI实战"},{"target":"_blank","url":"https://space.bilibili.com/480883651","name":"哔哩哔哩"},{"target":"_blank","url":"https://gitcode.com/nutpi","name":"GitCode"}],"footer":{"donate":{"wechat":"https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210922202901895.png","message":"随意打赏，但不要超过一顿早餐钱 💕","wxpay":"https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210922202901895.png","alipay":"https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210922202843746.png","nickname":"breeze","button":"打赏","wechatText":"微信","alipayText":"支付宝","title":"『赠人玫瑰 🌹 手有余香 』","avatar":"http://xkapp-uat.oss-cn-hangzhou.aliyuncs.com/2e7a3f70-80ab-4b50-93ec-a04dfeef949b/avatar-100.png"},"copyright":true}}},"title":"Flutter for Harmony教程","language":"zh-hans","gitbook":"*","description":"Flutter for Harmony电子书教程"},"file":{"path":"chapter12/12.4适配三方库之udid.md","mtime":"2025-09-04T00:17:16.190Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2025-09-14T05:25:49.343Z"},"basePath":"..","book":{"language":""}});
    });
  </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-edit-link/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-back-to-top-button/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-code/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-pageview-count/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-plus/jquery.mark.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-plus/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing-plus/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-gitcode-issue-feedback/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-forkmegithub/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-theme-lou/jweixin-1.6.0.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-theme-lou/lou.js"></script>
        
    

    </body>
</html>

